FEAT: added verifyPasswordResetCode endpoint

This commit is contained in:
Arthur Simas
2022-05-30 17:17:50 -03:00
parent c920eb27b9
commit 50da33b766
6 changed files with 50 additions and 8 deletions
+19
View File
@@ -14,6 +14,7 @@ import {
AuthVerifyTotpMfaRequest,
AuthChangePasswordRequest,
AuthResetPasswordRequest,
AuthVerifyResetPasswordCodeRequest,
AuthConfirmResetPasswordRequest,
} from '@victorradael/protospack';
@@ -188,6 +189,24 @@ export class AuthController {
return response;
}
@Post('verify-reset-password-code')
@HttpCode(HttpStatus.OK)
async verifyResetPasswordCode(
@Body() body: AuthVerifyResetPasswordCodeRequest,
): Promise<any> {
console.log(`/auth`, 'verify-reset-password-code');
const { username, code } = body;
const response = await this.authClient
.verifyResetPasswordCode({ username, code })
.catch((err) => {
throw ErrorBuilder(err);
});
return response;
}
@Post('confirm-reset-password')
@HttpCode(HttpStatus.OK)
async confirmResetPassword(