feat: pass all options through getSignInUrl and getSignUpUrl#36
Merged
feat: pass all options through getSignInUrl and getSignUpUrl#36
Conversation
Previously these convenience functions only accepted returnPathname, ignoring other options like state. Now they pass through all GetAuthorizationUrlOptions (state, organizationId, loginHint, etc.), matching the authkit-nextjs behavior. Fixes #33
Greptile SummaryThis PR enhances Key Changes:
The implementation is clean, well-tested, and solves the user's reported issue (#33) where they couldn't pass state through auth functions when migrating from authkit-react. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant getSignInUrl
participant AuthKit
participant WorkOS
Client->>getSignInUrl: Call with options {state, organizationId, loginHint, etc.}
Note over getSignInUrl: Convert string to options if needed
Note over getSignInUrl: typeof data === 'string' ? {returnPathname: data} : data
getSignInUrl->>AuthKit: getSignInUrl(options)
AuthKit->>WorkOS: Generate authorization URL with all options
WorkOS-->>AuthKit: Authorization URL
AuthKit-->>getSignInUrl: Authorization URL
getSignInUrl-->>Client: Return URL with state parameter embedded
|
dandorman
approved these changes
Dec 18, 2025
Merged
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
getSignInUrlandgetSignUpUrlto pass through allGetAuthorizationUrlOptions(state, organizationId, loginHint, redirectUri, prompt)Why
Users coming from authkit-react expect to pass
statethrough auth functions to handle custom sign-in flows (e.g.,signIn({ state: 'create-event' })). Previously these options were ignored.Fixes #33
Notes
Aligns with authkit-nextjs behavior where
getSignInUrl({ state: '...' })passes state through the OAuth flow.