Skip to content
Snippets Groups Projects
Commit da9b8496 authored by Jérémie BRISON's avatar Jérémie BRISON
Browse files

fix(user) : verify if email already used in formAccount input

parent 928bf58b
No related branches found
No related tags found
3 merge requests!38Recette,!37Dev,!29fix(user) : verify if email already used in formAccount input
...@@ -86,4 +86,9 @@ export class UsersController { ...@@ -86,4 +86,9 @@ export class UsersController {
public async resetPasswordApply(@Body() passwordResetApplyDto: PasswordResetApplyDto) { public async resetPasswordApply(@Body() passwordResetApplyDto: PasswordResetApplyDto) {
return this.usersService.validatePasswordResetToken(passwordResetApplyDto.password, passwordResetApplyDto.token); return this.usersService.validatePasswordResetToken(passwordResetApplyDto.password, passwordResetApplyDto.token);
} }
@Post('verify-exist-user')
public async verifyUserExist(@Request() req, @Body() email: { newMail: string }) {
return this.usersService.verifyUserExist(email.newMail);
}
} }
...@@ -407,4 +407,9 @@ export class UsersService { ...@@ -407,4 +407,9 @@ export class UsersService {
user.save(); user.save();
}); });
} }
public async verifyUserExist(email: string): Promise<Boolean> {
const user = await this.findOne(email);
return user ? true : false;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment