fix(auth): preserve organization invitations through login - #2528
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3baf39f1f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14799e817d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
14799e8 to
18072df
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18072df35a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
18072df to
f8e7a4e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8e7a4e9dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d76b4b71b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47f8579c19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79853bd581
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3923fee0d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onMount(async () => { | ||
| if (accessToken.current) { | ||
| try { | ||
| await logout(); |
There was a problem hiding this comment.
Release the auth form when logout rejects
When a user opens this page with a stored access token and the logout request rejects because the API is unavailable, times out, or returns an unexpected error, this catch leaves accessToken.current unchanged. The container therefore remains inert={!!accessToken.current}, making every login control unusable despite the comment saying the flow can continue; the signup page has the same failure mode. Clear the local session on failure or track logout progress separately from the access token.
Useful? React with 👍 / 👎.
Summary
The invitation email already links to
/signup?token=...onmain. The legacy login and signup flows forwardedInviteTokento OAuth providers and logged out an existing authenticated session. This PR restores that behavior in the Svelte client and closes the backend gap that allowed invitation authentication to enter the account-linking branch.This PR does not change organization persistence, organization selection, organization switching or impersonation, organization routes, or the
ExternalAuthInfomodel/order. Organization state and logout persistence behavior remain identical tomain.Verification
dotnet build tests/Exceptionless.Tests/Exceptionless.Tests.csproj --disable-build-servers -m:1(0 warnings, 0 errors)AuthEndpointTestsexecutable run (51 passed), with all new external-auth cases using GitHubAuthHandlerline is hit and the invite-versus-linking condition has 100% branch coverageOpenApiSnapshotTestsexecutable run (4 passed)npm run check(0 errors, 0 warnings)git diff --checktest-client,test-api,test-e2e, anddocker-buildchecks passed on the prior pushed head; the latest auth-page cleanup is running the same checks nowPost-Deploy Monitoring & Validation
Verify that existing password users and new OAuth users can accept organization invitations from tokenized signup/login links, including when public account creation is disabled. Confirm the invitation is consumed, membership appears, and ordinary authenticated OAuth continues to link the current account.