generated from xgeekshq/oss-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: reset token and mailer * feat: reset token * feat: reset token * chore: package-lock update * chore: updated dependencies * chore: minor bug fix * feat: reset token frontend * feat: reset token update password backend * feat: reset password * chore: minor bug fixes * feat: reset token and mailer * feat: reset token * chore: package-lock update * chore: updated dependencies * chore: minor bug fix * feat: reset token frontend * feat: reset token update password backend * feat: reset password * feat: reset password reset password * chore: merge fixes * fix: rebase fix: rebase * chore: merge fixes * chore: merge fixes * chore: merge fixes * chore: pr suggestion * chore: pr suggestions frontend * chore: frontend bug fixes * chore: pr sugestions * chore: route fixes * chore: new route * chore: pr suggestions * chore: pr suggestions Frontend * chore: new pr suggestions Frontend * chore: new pr suggestions backend * chore: pr suggestion * chore: change regex * chore: pr suggestion * chore: pr suggestions * fix: background fix
- Loading branch information
Showing
37 changed files
with
694 additions
and
4,089 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
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
10 changes: 10 additions & 0 deletions
10
backend/src/modules/auth/interfaces/applications/response.interface.ts
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,10 @@ | ||
// success: true => message, data | ||
// success: false => errorMessage, error | ||
|
||
export interface IResponse { | ||
success: boolean; | ||
message: string; | ||
errorMessage: string; | ||
data: unknown[]; | ||
error: unknown[]; | ||
} |
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
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
30 changes: 30 additions & 0 deletions
30
backend/src/modules/users/applications/update.user.application.ts
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,30 @@ | ||
import { Injectable, Inject } from '@nestjs/common'; | ||
|
||
import { UpdateUserApplication } from '../interfaces/applications/update.user.service.interface'; | ||
import { UpdateUserService } from '../interfaces/services/update.user.service.interface'; | ||
|
||
import { TYPES } from '../interfaces/types'; | ||
|
||
@Injectable() | ||
export class UpdateUserApplicationImpl implements UpdateUserApplication { | ||
constructor( | ||
@Inject(TYPES.services.UpdateUserService) | ||
private updateUserService: UpdateUserService, | ||
) {} | ||
|
||
setCurrentRefreshToken(refreshToken: string, userId: string) { | ||
return this.updateUserService.setCurrentRefreshToken(refreshToken, userId); | ||
} | ||
|
||
setPassword(userEmail: string, newPassword: string, newPasswordConf: string) { | ||
return this.updateUserService.setPassword( | ||
userEmail, | ||
newPassword, | ||
newPasswordConf, | ||
); | ||
} | ||
|
||
checkEmail(token: string) { | ||
return this.updateUserService.checkEmail(token); | ||
} | ||
} |
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,28 @@ | ||
import { Transform, TransformFnParams } from 'class-transformer'; | ||
import { IsNotEmpty, IsString, Matches, MinLength } from 'class-validator'; | ||
|
||
export class ResetPasswordDto { | ||
@IsString() | ||
@IsNotEmpty() | ||
token!: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@Transform(({ value }: TransformFnParams) => value.trim()) | ||
@MinLength(7) | ||
@Matches(/^(?=.*[A-Za-z])(?=.*\d)(?=.*\W)[A-Za-z\d\W]{8,}/, { | ||
message: | ||
'Password too weak. Must have 1 uppercase, 1 lowercase, 1 number and 1 special character', | ||
}) | ||
newPassword!: string; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@Transform(({ value }: TransformFnParams) => value.trim()) | ||
@MinLength(7) | ||
@Matches(/^(?=.*[A-Za-z])(?=.*\d)(?=.*\W)[A-Za-z\d\W]{8,}/, { | ||
message: | ||
'Password too weak. Must have 1 uppercase, 1 lowercase, 1 number and 1 special character', | ||
}) | ||
newPasswordConf!: string; | ||
} |
15 changes: 15 additions & 0 deletions
15
backend/src/modules/users/interfaces/applications/update.user.service.interface.ts
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,15 @@ | ||
import { LeanDocument } from 'mongoose'; | ||
import { UserDocument } from '../../schemas/user.schema'; | ||
|
||
export interface UpdateUserApplication { | ||
setCurrentRefreshToken( | ||
refreshToken: string, | ||
userId: string, | ||
): Promise<LeanDocument<UserDocument> | null>; | ||
setPassword( | ||
userEmail: string, | ||
newPassword: string, | ||
newPasswordConf: string, | ||
): Promise<UserDocument | null>; | ||
checkEmail(token: string): Promise<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
Oops, something went wrong.