fix: complete mystira identity session handoff#159
Conversation
There was a problem hiding this comment.
💡 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) => { |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Live finding
Identity logs confirm OmniPost attempts landed on Mystira Identity: authorization and token requests for client
neuralliquid-omnipost-webwere validated around 2026-07-18T22:01:55Z and 22:02:07Z. Identity returned id_token/access_token, then rejected the userinfo access token withinvalid_token/ missingsub. 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