cds-snc / platform-forms-client

NextJS application that serves the public-facing website for Forms
https://forms-staging.cdssandbox.xyz/
MIT License
31 stars 12 forks source link

Fix: mfa resend when no session #3808

Closed bryan-robitaille closed 3 weeks ago

bryan-robitaille commented 3 weeks ago

Summary | Résumé

take 2 of #3801

Updates the handling of 2fa "resend code" path errors.

Adds a log entry that identifies the email address trying to request a new token {"level":"warn","time":1718129549075,"msg":"Failed to send new verification code. Reason: Missing 2FA session for user bryan.robitaille@cds-snc.ca."}
Fixes the error path to ensure the server redirects the user to /auth/login if a session does not exist instead of relying on the browser. In NODE_ENV Production the error was being sanitized and wasn't being properly handled client side.

Also modifies the "form submission" event log to identify that it is a form submission and not just listing the form ID.

github-actions[bot] commented 3 weeks ago

:test_tube: Review environment

https://u2w3atxdhjjbs263xj2vggzkoi0tbltw.lambda-url.ca-central-1.on.aws/