fix(auth): preserve addAccount param through SSO redirect#877
Closed
Just-Insane wants to merge 3 commits into
Closed
fix(auth): preserve addAccount param through SSO redirect#877Just-Insane wants to merge 3 commits into
Just-Insane wants to merge 3 commits into
Conversation
When adding a second account via SSO login/registration, the addAccount=1 parameter was not preserved through the SSO provider redirect. This caused the system to treat it as a primary login instead of adding an account, effectively blocking users from adding additional accounts when their first account used SSO. Changes: - Login.tsx: Check for addAccount param and include it in ssoRedirectUrl - Register.tsx: Same fix for SSO registration flow - Register.tsx: Import withSearchParam utility Flow now works: 1. User clicks "Add Account" → navigates with ?addAccount=1 2. User chooses SSO → redirectUrl includes ?addAccount=1 3. SSO provider redirects back → addAccount=1 preserved 4. Login completes → system knows to add account, not replace Fixes issue where SSO accounts blocked adding any other accounts (SSO or non-SSO).
Member
|
#882 seems to fix this as well 🤷♀️ |
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.
Description
When an SSO login is initiated for a second account (with
?addAccount=true), the parameter was not preserved across the provider redirect and was silently discarded. The returning user was logged in as a new primary session instead of being added to the multi-account switcher. This fix threads theaddAccountparameter through the SSO callback URL so it survives the redirect.Fixes #
Type of change
Checklist:
AI disclosure:
The fix reads
addAccountfrom the pre-redirect query string and appends it to theredirectUripassed to the identity provider, so after the provider redirects back to Sable the login handler adds the session to the multi-account switcher instead of replacing the current session.