Skip to content

fix(auth): preserve organization invitations through login - #2528

Merged
ejsmith merged 12 commits into
mainfrom
feature/invitation-auth-flow
Aug 27, 2026
Merged

fix(auth): preserve organization invitations through login#2528
ejsmith merged 12 commits into
mainfrom
feature/invitation-auth-flow

Conversation

@niemyjski

@niemyjski niemyjski commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

  • forwards invitation tokens through password and OAuth login/signup flows
  • starts logout after either auth page loads when a session exists, matching the legacy client behavior without adding a page-level loader
  • preserves the invitation token when switching between the login and signup routes
  • keeps invitation OAuth authentication separate from authenticated account linking while preserving normal OAuth account linking
  • permits an invited OAuth user to create an account when general account creation is disabled and rejects invalid invitation tokens
  • adds backend endpoint and end-to-end coverage for invitation acceptance

The invitation email already links to /signup?token=... on main. The legacy login and signup flows forwarded InviteToken to 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 ExternalAuthInfo model/order. Organization state and logout persistence behavior remain identical to main.

Verification

  • dotnet build tests/Exceptionless.Tests/Exceptionless.Tests.csproj --disable-build-servers -m:1 (0 warnings, 0 errors)
  • focused AuthEndpointTests executable run (51 passed), with all new external-auth cases using GitHub
  • focused coverage confirms every changed executable AuthHandler line is hit and the invite-versus-linking condition has 100% branch coverage
  • focused OpenApiSnapshotTests executable run (4 passed)
  • npm run check (0 errors, 0 warnings)
  • targeted Prettier checks
  • git diff --check
  • hosted test-client, test-api, test-e2e, and docker-build checks passed on the prior pushed head; the latest auth-page cleanup is running the same checks now

Post-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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@niemyjski
niemyjski force-pushed the feature/invitation-auth-flow branch from 14799e8 to 18072df Compare August 26, 2026 02:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@niemyjski niemyjski self-assigned this Aug 27, 2026
@niemyjski
niemyjski force-pushed the feature/invitation-auth-flow branch from 18072df to f8e7a4e Compare August 27, 2026 12:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/Exceptionless.Web/ClientApp/src/lib/features/auth/index.svelte.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/Exceptionless.Web/ClientApp/src/routes/(auth)/login/+page.svelte Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/Exceptionless.Web/ClientApp/src/routes/(auth)/signup/+page.svelte Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Insulation 37% 35% 286
Exceptionless.Core 76% 67% 10288
Exceptionless.Web 85% 69% 7974
Exceptionless.AppHost 38% 41% 147
Summary 79% (25559 / 32524) 68% (11973 / 17719) 18695

@ejsmith
ejsmith merged commit bc90aa8 into main Aug 27, 2026
12 checks passed
@ejsmith
ejsmith deleted the feature/invitation-auth-flow branch August 27, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants