Skip to content

Commit

Permalink
add more detailed log message
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-robitaille committed Jun 11, 2024
1 parent 5fbb9bc commit d5fcd57
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/auth/cognito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ export const requestNew2FAVerificationCode = async (
return verificationCode;
} catch (error) {
if (error instanceof Missing2FASession) {
logMessage.warn(
`Failed to send new verificaiton code. User ${email} does not have an existing authentication flow token`
);
throw error;
} else {
throw new Error(`Failed to send new verification code. Reason: ${(error as Error).message}.`);
Expand Down

0 comments on commit d5fcd57

Please sign in to comment.