Skip to content

Add MFA handling to AuthenticationLoading component#111

Open
meauxt wants to merge 1 commit into
developfrom
issue-108
Open

Add MFA handling to AuthenticationLoading component#111
meauxt wants to merge 1 commit into
developfrom
issue-108

Conversation

@meauxt

@meauxt meauxt commented May 25, 2026

Copy link
Copy Markdown
Contributor

Enhances the OAuth2 authentication flow in Authenticating.jsx by adding support for multi-factor authentication (MFA).

fix #108

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enhances the OAuth2 callback handler in AuthenticationLoading to correctly handle backend responses that require MFA, preventing invalid/undefined tokens from being stored and guiding the user through MFA verification before completing login.

Changes:

  • Adds MFA state + MFAVerificationModal wiring to the OAuth2 callback flow.
  • Switches token persistence from direct localStorage writes to centralized saveTokens.
  • Improves OAuth2 callback error handling and validates presence of tokens / MFA session token.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +208 to +211
onError={() => {
setMessage('Authentication failed')
setSubMessage('Two-factor authentication failed. Please try again')
}}
Comment on lines 91 to 93
const redirectURI = Capacitor.isNativePlatform()
? 'donetick://auth/oauth2'
: `${window.location.origin}/auth/oauth2`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OAuth2/OIDC login silently fails when user has MFA enable

2 participants