Skip to content

fix(api): tombstone deleted Auth0 identities - #64

Merged
Bitstachio merged 2 commits into
mainfrom
api/fix-deleted-account-token
Sep 15, 2026
Merged

Bitstachio merged 2 commits into
mainfrom
api/fix-deleted-account-token

Conversation

@Bitstachio

@Bitstachio Bitstachio commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Fixes Problem 2 (JWT resurrection via auto-provisioning) from the account-deletion work in #37. After Auth0-first delete, an unexpired access token could still JIT-create a User for the same providerSub. On hard delete we upsert a DeletedProviderSub tombstone in the same transaction as user.delete; resolveByProviderSub refuses tombstoned (and mid-deletion) identities with a generic 401 so the client learns nothing beyond “unauthorized.” Follows the issue’s tombstone path; deviations: store providerSub plaintext (not hashed), return 401 only (not 410), and keep formerUserId for audit. Event/photo prep remains out of scope.

Resolves #37

@github-actions

Copy link
Copy Markdown

API unit-test coverage

Metric Coverage
Statements 76.04% (943/1240)
Branches 58.54% (401/685)
Functions 78.97% (169/214)
Lines 74.61% (823/1103)

Unit suite only; controllers are exercised by the e2e suite.

@Bitstachio
Bitstachio merged commit 6f1aa7a into main Sep 15, 2026
4 checks passed
@Bitstachio
Bitstachio deleted the api/fix-deleted-account-token branch September 15, 2026 14:46
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.

Account deletion must delete the Auth0 identity and prevent JWT resurrection

1 participant