feat: add verify otp endpoint
This commit is contained in:
@@ -84,8 +84,9 @@ export class OtpService {
|
||||
throw new UnauthorizedException('OTP expired');
|
||||
}
|
||||
|
||||
// TODO: Compared hashed otp
|
||||
if (otp.code !== code) {
|
||||
const isOTPCorrect = await this.hashingProvider.compare(code, otp.code);
|
||||
|
||||
if (!isOTPCorrect) {
|
||||
throw new UnauthorizedException('Invalid OTP');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user