Merged
Conversation
Merged origin/main into auth-next branch, resolving conflicts in: - ZkEvmWorkflow.tsx: Kept auth-next config with ZkEvmProvider type - PassportProvider.tsx: Kept improved error handling from auth-next - index.page.tsx: Merged AuthNextJS and ArbitrumWorkflow features - wallet/package.json: Added sequence deps from main with newer @swc/core
rodrigo-fournier-immutable
added a commit
that referenced
this pull request
Feb 10, 2026
Add E2E tests for default auth functionality in wallet package. Tests cover: - Auth instance creation with auto-configuration - ClientId auto-detection (sandbox vs production) - PassportDomain derivation from chain config - Popup callback handling for OAuth flow - Query string management during auth callback - Provider creation without external getUser - Error handling for auth failures This validates the default auth implementation added by Shine Li in PR #2768 (feat(passport): nextjs packages). All 28 tests passing: - 7 tests for Auth instance creation - 6 tests for clientId auto-detection - 4 tests for popup callback handling - 4 tests for provider creation - 2 tests for error handling - 5 tests for existing functionality Co-authored-by: Cursor <cursoragent@cursor.com>
rodrigo-fournier-immutable
added a commit
that referenced
this pull request
Feb 10, 2026
…etection
Implement default authentication for auth-next-client/server packages
to provide zero-config setup for developers.
auth-next-server changes:
- Add createDefaultAuthConfig() function with optional configuration
- Auto-detect clientId based on environment (sandbox vs production)
- Auto-derive redirectUri from window.location.origin + '/callback'
- Export default client IDs and constants for consumer use
- Uses public Immutable client IDs for development convenience
auth-next-client changes:
- Update useLogin hook to accept optional config (all fields)
- Update useLogout hook to accept optional config
- Add helper functions to create complete configs with defaults
- Auto-detect clientId, redirectUri, popupRedirectUri, logoutRedirectUri
- Export default constants for direct consumer use
This enables minimal setup:
// Server (lib/auth.ts)
export const { handlers, auth } = NextAuth(createDefaultAuthConfig());
// Client
const { loginWithPopup } = useLogin();
await loginWithPopup(); // No config needed!
const { logout } = useLogout();
await logout(); // No config needed!
Consumers can still override any field as needed for production use.
Related to wallet package default auth implementation (PR #2768).
Co-authored-by: Cursor <cursoragent@cursor.com>
7 tasks
rodrigo-fournier-immutable
added a commit
that referenced
this pull request
Feb 10, 2026
…etection
Implement default authentication for auth-next-client/server packages
to provide zero-config setup for developers.
auth-next-server changes:
- Add createDefaultAuthConfig() function with optional configuration
- Auto-detect clientId based on environment (sandbox vs production)
- Auto-derive redirectUri from window.location.origin + '/callback'
- Export default client IDs and constants for consumer use
- Uses public Immutable client IDs for development convenience
auth-next-client changes:
- Update useLogin hook to accept optional config (all fields)
- Update useLogout hook to accept optional config
- Add helper functions to create complete configs with defaults
- Auto-detect clientId, redirectUri, popupRedirectUri, logoutRedirectUri
- Export default constants for direct consumer use
This enables minimal setup:
// Server (lib/auth.ts)
export const { handlers, auth } = NextAuth(createDefaultAuthConfig());
// Client
const { loginWithPopup } = useLogin();
await loginWithPopup(); // No config needed!
const { logout } = useLogout();
await logout(); // No config needed!
Consumers can still override any field as needed for production use.
Related to wallet package default auth implementation (PR #2768).
Co-authored-by: Cursor <cursoragent@cursor.com>
rodrigo-fournier-immutable
added a commit
that referenced
this pull request
Feb 11, 2026
Add E2E tests for default auth functionality in wallet package. Tests cover: - Auth instance creation with auto-configuration - ClientId auto-detection (sandbox vs production) - PassportDomain derivation from chain config - Popup callback handling for OAuth flow - Query string management during auth callback - Provider creation without external getUser - Error handling for auth failures This validates the default auth implementation added by Shine Li in PR #2768 (feat(passport): nextjs packages). All 28 tests passing: - 7 tests for Auth instance creation - 6 tests for clientId auto-detection - 4 tests for popup callback handling - 4 tests for provider creation - 2 tests for error handling - 5 tests for existing functionality Co-authored-by: Cursor <cursoragent@cursor.com>
rodrigo-fournier-immutable
added a commit
that referenced
this pull request
Feb 11, 2026
…etection
Implement default authentication for auth-next-client/server packages
to provide zero-config setup for developers.
auth-next-server changes:
- Add createDefaultAuthConfig() function with optional configuration
- Auto-detect clientId based on environment (sandbox vs production)
- Auto-derive redirectUri from window.location.origin + '/callback'
- Export default client IDs and constants for consumer use
- Uses public Immutable client IDs for development convenience
auth-next-client changes:
- Update useLogin hook to accept optional config (all fields)
- Update useLogout hook to accept optional config
- Add helper functions to create complete configs with defaults
- Auto-detect clientId, redirectUri, popupRedirectUri, logoutRedirectUri
- Export default constants for direct consumer use
- Align popupRedirectUri behavior with @imtbl/auth and @imtbl/wallet
(uses same '/callback' path instead of separate '/callback/popup')
This enables minimal setup:
// Server (lib/auth.ts)
export const { handlers, auth } = NextAuth(createDefaultAuthConfig());
// Client
const { loginWithPopup } = useLogin();
await loginWithPopup(); // No config needed!
const { logout } = useLogout();
await logout(); // No config needed!
Consumers can still override any field as needed for production use.
All tests passed:
✅ Zero-config login with popup
✅ Zero-config logout with federated logout
✅ Custom config overrides (partial and full)
✅ Session management
✅ Auto-detection of environment (sandbox vs production)
Related to wallet package default auth implementation (PR #2768).
Co-authored-by: Cursor <cursoragent@cursor.com>
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
Created packages that work with nextjs.
auth-next-client/server packages are introduced to make it easier to work with next-auth.js. Sessions and jwt (including refresh) are handled purely server side.
Wallet package has been updated to work this setup and is also compatible with auth and passport packages.