Skip to content

Commit

Permalink
fix(provider): minor fix in otp strategy
Browse files Browse the repository at this point in the history
minor fix in OTP strategy, and added few error keys

gh-69
  • Loading branch information
AnkurBansalSF committed Apr 29, 2022
1 parent edb6c68 commit 8f5427c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/error-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ export const enum AuthErrorKeys {
InvalidCredentials = 'Invalid Credentials',
UnknownError = 'Unknown Error',
WrongPassword = 'Incorrect Password',
KeyInvalid = 'Key Invalid',
OtpInvalid = 'Otp Invalid',
OtpExpired = 'Otp Token Incorrect or Expired',
}
2 changes: 1 addition & 1 deletion src/strategies/passport/passport-otp/otp-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export namespace Otp {
const key = req.body.key || options?.key;
const otp = req.body.otp || options?.otp;

if (!key || !otp) {
if (!key) {
this.fail();
return;
}
Expand Down

0 comments on commit 8f5427c

Please sign in to comment.