Skip to content

fix: complete mystira identity session handoff#159

Merged
JustAGhosT merged 1 commit into
mainfrom
agent/fix-csp-report-only-noise
Jul 18, 2026
Merged

fix: complete mystira identity session handoff#159
JustAGhosT merged 1 commit into
mainfrom
agent/fix-csp-report-only-noise

Conversation

@JustAGhosT

Copy link
Copy Markdown
Collaborator

Summary

  • remove the stale CSP report-only header that generated console-only inline script warnings with no report endpoint
  • let Mystira OIDC callback fall back to id_token claims when userinfo rejects the access token
  • add a cookie-backed /api/auth/session endpoint and hydrate the client AuthProvider from it after OIDC redirects
  • align security-header docs with shipped headers

Live finding

Identity logs confirm OmniPost attempts landed on Mystira Identity: authorization and token requests for client neuralliquid-omnipost-web were validated around 2026-07-18T22:01:55Z and 22:02:07Z. Identity returned id_token/access_token, then rejected the userinfo access token with invalid_token / missing sub. OmniPost previously did not fall back to id_token claims, and even a successful callback only set an HTTP-only cookie that the client auth guard did not hydrate from.

Validation

  • pnpm exec jest tests/lib/identity-provider.test.ts --runInBand
  • pnpm exec eslint components/providers/AuthProvider.tsx lib/api-client.ts lib/auth/identity-provider.ts app/api/auth/session/route.ts tests/lib/identity-provider.test.ts
  • pnpm exec prettier --check next.config.ts components/providers/AuthProvider.tsx lib/api-client.ts lib/auth/identity-provider.ts app/api/auth/session/route.ts tests/lib/identity-provider.test.ts docs/ARCHITECTURE.md
  • pnpm run type-check
  • pnpm run build

@JustAGhosT
JustAGhosT merged commit 0526b65 into main Jul 18, 2026
7 checks passed
@JustAGhosT
JustAGhosT deleted the agent/fix-csp-report-only-noise branch July 18, 2026 23:10

@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: 3b1a7f9b0c

ℹ️ 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".

import { withErrorHandling } from '../../_utils/errors';
import { authService } from '../../../../lib/auth/auth-service';

export const GET = withErrorHandling(async (_req: Request) => {

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 Add rate limiting to session checks

Because this new /api/auth/session route is public and the client now calls it on every auth-provider mount, leaving GET wrapped only in withErrorHandling lets any unauthenticated client hammer the endpoint and force repeated cookie/header parsing and JWT verification/logging. The neighboring public auth routes (/api/auth/providers and the OAuth callback) are wrapped with withRateLimit, and the repo rules require rate limiting on public endpoints, so this should use an appropriate preset before the error handler is exposed.

Useful? React with 👍 / 👎.

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.

1 participant