Skip to content

Handle code-based OIDC token exchange - #1336

Merged
DavidMStraub merged 2 commits into
gramps-project:mainfrom
DavidMStraub:oidc_code_auth
Aug 10, 2026
Merged

Handle code-based OIDC token exchange#1336
DavidMStraub merged 2 commits into
gramps-project:mainfrom
DavidMStraub:oidc_code_auth

Conversation

@DavidMStraub

Copy link
Copy Markdown
Member

This is the backward compatible frontend change corresponding to gramps-project/gramps-web-api#928.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the OIDC completion flow in the frontend to support a newer “authorization-code-in-fragment + frontend token exchange” mechanism while remaining compatible with older backend behavior.

Changes:

  • Prevents the /oidc/complete token exchange from running twice in the same page lifecycle.
  • Extracts an authorization code from the URL fragment, removes it from the address bar, and exchanges it via POST /api/oidc/tokens/.
  • Preserves backward compatibility by falling back to the legacy cookie-based GET /api/oidc/tokens/ when no code is present.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/oidc.js
@DavidMStraub
DavidMStraub merged commit b53440b into gramps-project:main Aug 10, 2026
1 check passed
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