Skip to content

Commit 14e7ae2

Browse files
authoredMay 5, 2022
fix(provider): minor fix in otp strategy (#70)
minor fix in OTP strategy, and added few error keys gh-69
1 parent edb6c68 commit 14e7ae2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎src/error-keys.ts

+3
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ export const enum AuthErrorKeys {
99
InvalidCredentials = 'Invalid Credentials',
1010
UnknownError = 'Unknown Error',
1111
WrongPassword = 'Incorrect Password',
12+
KeyInvalid = 'Key Invalid',
13+
OtpInvalid = 'Otp Invalid',
14+
OtpExpired = 'Otp Token Incorrect or Expired',
1215
}

‎src/strategies/passport/passport-otp/otp-auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export namespace Otp {
3737
const key = req.body.key || options?.key;
3838
const otp = req.body.otp || options?.otp;
3939

40-
if (!key || !otp) {
40+
if (!key) {
4141
this.fail();
4242
return;
4343
}

0 commit comments

Comments
 (0)