feat: add verify otp endpoint

This commit is contained in:
2026-02-26 09:14:30 +03:30
parent b9adbef7e8
commit 8212ede785
7 changed files with 65 additions and 7 deletions
-1
View File
@@ -23,7 +23,6 @@ export class OTP {
@Column({
type: 'varchar',
length: 5,
nullable: false,
})
code: string;
+3 -2
View File
@@ -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');
}