Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add ConnectOptions interface with username and authMethod
- Extend connect() method to infer headless mode from parameters
- Update Keychain interface to support headless connection requests
- Add HeadlessConnect component for programmatic authentication
- Modify Home component to handle headless flows
- Maintain full backward compatibility with existing modal flow
- Add comprehensive documentation and examples
This allows applications to authenticate users programmatically without
displaying the modal interface by providing username and authMethod:
await controller.connect({
username: 'alice',
authMethod: 'metamask'
});
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement MetaMask, Rabby, and WalletConnect headless authentication - Add proper signup/login flow detection and handling - Use existing authentication hooks for consistent behavior - Add clear error messages for unsupported methods (WebAuthn, social) - Create HeadlessAuth example component in Next.js app - Maintain backward compatibility with existing modal flow Supported headless methods: - metamask: External wallet connection - rabby: External wallet connection - walletconnect: Cross-platform wallet protocol Note: WebAuthn and social logins require user interaction and are not supported in headless mode. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
….js example - Fix incorrect @cartridge/ui component imports to use main export - Use ControllerConnector.fromConnectors pattern for headless auth - Remove unused connect variable to resolve linting error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
06bd800 to
af0538b
Compare
Fixes TypeScript compilation error by importing useConnection from @/hooks/connection 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Updated HeadlessConnect component to use handleSubmit from useCreateController - Fixed issue where controller wasn't being created after MetaMask authentication - Removed unused imports and simplified the authentication flow - Controller is now properly set on window object after successful auth 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
| address: controller.address(), | ||
| }); | ||
| } | ||
| }, [controller, context]); |
There was a problem hiding this comment.
Bug: Race Condition in Context Resolution
The component has two useEffect hooks that can independently resolve the ConnectCtx promise: one for handleHeadlessAuth errors and another for controller availability. This creates a race condition, potentially resolving the context prematurely or incorrectly, bypassing the intended authentication flow.
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
connect()method to infer headless mode when bothusernameandauthMethodare providedKey Changes
connect()method with optionalConnectOptionsparameterConnectOptionsinterface and updatedKeychaininterfaceHeadlessConnectcomponentAPI Usage
Test Plan
connect()calls work unchangedImplementation Status
✅ Core infrastructure and API design complete
🚧 Individual auth method implementations need completion in
HeadlessConnectcomponent🤖 Generated with Claude Code