Skip to content

feat: Auto-respond to URL challenges with one-click login#409

Merged
macterra merged 3 commits intomainfrom
feature/auto-auth-response
Apr 13, 2026
Merged

feat: Auto-respond to URL challenges with one-click login#409
macterra merged 3 commits intomainfrom
feature/auto-auth-response

Conversation

@macterra
Copy link
Copy Markdown
Collaborator

Summary

When a wallet receives a challenge via URL parameter (?challenge=did:...), it now automatically creates a response and displays a Login Request panel instead of requiring the user to manually click Resolve → Respond → Send.

Login Request Panel

  • Destination — callback URL where the response will be sent
  • Credentials — shows match status (fulfilled vs requested) with success/warning indicators
  • Response — the generated response DID
  • Login button — single click to send the response
  • Cancel — dismisses the panel and falls back to the existing manual auth UI

Changes

  • apps/react-wallet/src/components/AuthTab.tsx — auto-response logic triggered by pendingChallenge; Login Request panel UI
  • apps/browser-extension/src/components/AuthTab.tsx — same auto-response and Login Request panel
  • apps/browser-extension/src/contexts/AuthContext.tsx — added pendingAutoResponse flag
  • apps/browser-extension/src/contexts/UIContext.tsx — sets pendingAutoResponse when processing a URL challenge

The existing manual auth flow (New/Resolve/Respond/Decrypt/Verify/Send/Clear) remains fully accessible.

When a challenge arrives via URL parameter (?challenge=did:...),
the wallet now automatically:
1. Resolves the challenge to get callback URL and credential requirements
2. Creates a response with matching credentials
3. Displays a Login Request panel showing:
   - Destination URL (callback)
   - Credential match status (fulfilled/requested)
   - Response DID
4. Provides a single 'Login' button to send the response

The existing manual auth UI (New/Resolve/Respond/Decrypt/Verify/Send)
remains accessible when no auto-login is active or after dismissing.

Applies to both react-wallet and browser-extension.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an auto-response flow for URL-based auth challenges that generates a response automatically and presents a “Login Request” panel for one-click sending, while keeping the existing manual auth workflow available.

Changes:

  • Introduces auto-response generation triggered by pending URL challenges and a new “Login Request” panel UI in both the React wallet and browser extension.
  • Adds a pendingAutoResponse flag to coordinate auto-response triggering in the browser extension.
  • Updates browser-extension UI context to set the auto-response trigger when processing a URL challenge.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
apps/react-wallet/src/components/AuthTab.tsx Adds auto-response generation + Login Request panel and send action in the React wallet UI.
apps/browser-extension/src/components/AuthTab.tsx Mirrors the auto-response + Login Request panel behavior in the extension UI.
apps/browser-extension/src/contexts/AuthContext.tsx Adds pendingAutoResponse state to coordinate auto-response triggering.
apps/browser-extension/src/contexts/UIContext.tsx Sets pendingAutoResponse when a URL challenge is applied to the auth state.

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

Comment thread apps/browser-extension/src/components/AuthTab.tsx
Comment thread apps/react-wallet/src/components/AuthTab.tsx Outdated
Comment thread apps/react-wallet/src/components/AuthTab.tsx Outdated
Comment thread apps/react-wallet/src/components/AuthTab.tsx
…endResponse

- Post autoLogin.responseDID directly instead of relying on async
  React state, preventing stale/empty response on fast Login clicks.
- Set disableSendResponse based on callbackUrl presence unconditionally,
  preventing state leaking from prior interactions.
@macterra macterra merged commit f9068d3 into main Apr 13, 2026
25 checks passed
@macterra macterra deleted the feature/auto-auth-response branch April 13, 2026 21:47
@macterra macterra mentioned this pull request Apr 14, 2026
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.

2 participants