This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endpoint for registering new users (#231)
* added API endpoint, DTO, updated API schema * only enabled users get authenticated * Update backend/src/db/repositories/user.repository.ts --------- Co-authored-by: Henry Brink <[email protected]>
- Loading branch information
1 parent
e1c48b0
commit 3efbdd6
Showing
8 changed files
with
129 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,4 @@ | ||
import { IsEmail, IsOptional, Length } from 'class-validator'; | ||
import { PartialType } from '@nestjs/swagger'; | ||
import { RegisterUserDTO } from './register.user.dto'; | ||
|
||
export class PatchUserDTO { | ||
@IsEmail() | ||
@IsOptional() | ||
email: string | undefined; | ||
|
||
@Length(12, 72) | ||
@IsOptional() | ||
password: string | undefined; | ||
|
||
@Length(2, 128) | ||
@IsOptional() | ||
displayName: string | undefined; | ||
} | ||
export class PatchUserDTO extends PartialType(RegisterUserDTO) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { IsEmail, Length } from 'class-validator'; | ||
|
||
export class RegisterUserDTO { | ||
@IsEmail() | ||
email: string; | ||
|
||
@Length(12, 72) | ||
password: string; | ||
|
||
@Length(2, 128) | ||
displayName: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,13 +15,39 @@ externalDocs: | |
url: https://github.com/SE-TINF22B2/G5-DuoGradus | ||
tags: | ||
- name: User | ||
description: Endpoints relatexd to the user, his account and other personal configurations | ||
description: Endpoints related to the user, his account and other personal configurations | ||
- name: Datasource | ||
description: Thirdparty data sources, like FitBit | ||
- name: Leaderboard | ||
- name: Goal | ||
description: User and system defined Goals | ||
paths: | ||
'/user': | ||
post: | ||
summary: Registers a new user | ||
tags: | ||
- User | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
email: | ||
type: string | ||
displayName: | ||
type: string | ||
password: | ||
type: string | ||
example: | ||
name: Ingolf Neiße | ||
email: [email protected] | ||
password: password123 | ||
responses: | ||
'200': | ||
description: User registered successfully | ||
'400': | ||
description: Invalid content | ||
'/user/me': | ||
get: | ||
summary: Displays the current users settings | ||
|