feat: Auto-respond to URL challenges with one-click login#409
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
pendingAutoResponseflag 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.
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Changes
apps/react-wallet/src/components/AuthTab.tsx— auto-response logic triggered bypendingChallenge; Login Request panel UIapps/browser-extension/src/components/AuthTab.tsx— same auto-response and Login Request panelapps/browser-extension/src/contexts/AuthContext.tsx— addedpendingAutoResponseflagapps/browser-extension/src/contexts/UIContext.tsx— setspendingAutoResponsewhen processing a URL challengeThe existing manual auth flow (New/Resolve/Respond/Decrypt/Verify/Send/Clear) remains fully accessible.