Title: OIDC server_error after account delete + re-create (stale session) · Issue #452 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: OIDC server_error after account delete + re-create (stale session) · Issue #452 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: OIDC server_error after account delete + re-create (stale session) · Issue #452 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Bug After deleting an account via /idp/account/delete and re-creating it with the same username, OIDC authorization fails with: Authentication Error — server_error — oops! something went wrong This is a recurring issue. Cause The error i...
Open Graph Description: Bug After deleting an account via /idp/account/delete and re-creating it with the same username, OIDC authorization fails with: Authentication Error — server_error — oops! something went wrong This...
X Description: Bug After deleting an account via /idp/account/delete and re-creating it with the same username, OIDC authorization fails with: Authentication Error — server_error — oops! something went wrong This...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/452
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OIDC server_error after account delete + re-create (stale session)","articleBody":"## Bug\n\nAfter deleting an account via `/idp/account/delete` and re-creating it with the same username, OIDC authorization fails with:\n\n> **Authentication Error** — server_error — oops! something went wrong\n\nThis is a recurring issue.\n\n## Cause\n\nThe error in the logs:\n\n```\nTypeError: Cannot read properties of undefined (reading 'getOIDCScopeEncountered')\n at Check.oidc.oidc (oidc-provider/lib/helpers/interaction_policy/prompts/consent.js:29:50)\n at oidc-provider/lib/actions/authorization/interactions.js:18:17\n```\n\nThe flow:\n1. User deletes their account — account data and grants are removed\n2. User re-creates account with same username\n3. Client (e.g. mashlib-next) still has old session cookies/tokens and sends `prompt=consent` to `/idp/auth`\n4. `loadExistingGrant()` in `provider.js` checks `ctx.oidc.session` which is undefined (stale session)\n5. Returns `undefined` — no grant object\n6. oidc-provider's consent check calls `getOIDCScopeEncountered()` on the undefined grant → TypeError → 500\n\n## Possible fixes\n\n1. **Clear OIDC session cookies on account deletion** — when `/idp/account/delete` runs, ensure session cookies are invalidated so the browser doesn't send stale tokens\n2. **Guard in `loadExistingGrant`** — return a new grant (auto-approve) when session exists but old grant is gone, rather than returning undefined\n3. **Error handler** — catch this specific error and redirect to login instead of showing server_error\n\n## Steps to reproduce\n\n1. Register an account on a JSS instance\n2. Log in via OIDC from a client app\n3. Delete the account via `/idp/account/delete`\n4. Re-register with the same username\n5. Try to log in again from the same browser → server_error","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-14T20:12:04Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/452"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:875e4a98-1291-0d40-0923-cdd568b45c9c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EA8:232DFC:9A3BD7:C36E26:6B03A2B6 |
| html-safe-nonce | d06598325a851dc2feda344c98ca0ebac928e8762e24e7d986065d0b085d0cf5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUE4OjIzMkRGQzo5QTNCRDc6QzM2RTI2OjZCMDNBMkI2IiwidmlzaXRvcl9pZCI6IjIyODc4ODA4MDA2NDcyMjYwMzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bc024d537f0b3d0204db76c5d4942d00fe4ed0cf03b44d18ddb730bbc70b674e |
| hovercard-subject-tag | issue:4448948657 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/452/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5d9e8cb1b1bab2ef0ae6aacf9ccae22520d05e1f1a1e09424e90e641dcb7bcd/JavaScriptSolidServer/JavaScriptSolidServer/issues/452 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5d9e8cb1b1bab2ef0ae6aacf9ccae22520d05e1f1a1e09424e90e641dcb7bcd/JavaScriptSolidServer/JavaScriptSolidServer/issues/452 |
| og:image:alt | Bug After deleting an account via /idp/account/delete and re-creating it with the same username, OIDC authorization fails with: Authentication Error — server_error — oops! something went wrong This... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width