errno0x0d
errno0x0d#7980
Joined Nov 8, 2026
Sign in to search- On OIDC/SSO flow drops invite code context (multi-community auto-join issue)After inspecting the codebase, the fix is even simpler than expected because the client and OAuth state handling are already doing their job!
AuthLoginLayout.tsxalready passesredirect_to: ssoRedirectPath(e.g./invite/<code_b>) toPOST /v1/auth/sso/start.startSsopreserves it instatePayload.redirectTo.completeLogininSsoService.tsalready retrievesconst redirectTo = statePayload.redirectTo ?? ''.
resolveUserFromClaimsdoes not receiveredirectTo, so it only falls back toconfig.instance.autoJoinInviteCode.Suggested fix in
SsoService.ts&SsoUtils.ts:- In
SsoUtils.ts:export function extractInviteCodeFromRedirect ( redirectTo ?:string ) :string | null { const sanitized = sanitizeSsoRedirectTo ( redirectTo ); if ( ! sanitized ) return null ; const match = sanitized . match ( / ^\/invite\/([a-zA-Z0-9_-]+)(?:[?#]|$) / ); return match ?match [ 1 ] :null ; }
- In
SsoService.ts:
redirectTointoresolveUserFromClaims(..., redirectTo)and resolve the effective invite code matching theGuildEntry.tspattern (inviteCode || autoJoinInviteCode):This guarantees that:const inviteCodeFromRedirect = extractInviteCodeFromRedirect ( redirectTo ); const autoJoinInviteCode = inviteCodeFromRedirect || this . apiContext . services . config . instance . autoJoinInviteCode ?. trim () || null ; - Visitors arriving via a specific
/invite/<code_b>link auto-join that specific guild upon SSO completion. - Generic visitors without an invite link still fall back to
FLUXER_AUTO_JOIN_INVITE_CODE.
- Implementation suggestion to easily fix this:
- In the client apps (Web, Desktop, Mobile): When an unauthenticated visitor clicks "Login with SSO" on an /invite/:code landing screen, ensure POST /v1/auth/sso/start includes
redirect_to: window.location.pathname(or an explicitinvite_codeparameter) so it gets preserved in the OAuthstatePayload.
- In SsoService (completeLogin / resolveUserFromClaims): Extract the invite code from
statePayload.redirectToif it matches/invite/:codeand prioritize it:
This ensures the user seamlessly lands inside the specific invited guild across all platforms, while preserving the staticconst inviteMatch = statePayload.redirectTo?.match(/\/invite\/([a-zA-Z0-9_-]+)/); const inviteCodeToJoin = inviteMatch ? inviteMatch[1] : autoJoinInviteCode; if (inviteCodeToJoin) { await maybeAutoJoinInvite(this.inviteService, { userId: user.id, inviteCode: inviteCodeToJoin, requestCache }); }FLUXER_AUTO_JOIN_INVITE_CODEfallback for generic root signups. - In the client apps (Web, Desktop, Mobile): When an unauthenticated visitor clicks "Login with SSO" on an /invite/:code landing screen, ensure POST /v1/auth/sso/start includes