Skip to content

fix: prevent auth provider cache staleness#161

Merged
JustAGhosT merged 1 commit into
mainfrom
agent/fix-auth-provider-cache
Jul 19, 2026
Merged

fix: prevent auth provider cache staleness#161
JustAGhosT merged 1 commit into
mainfrom
agent/fix-auth-provider-cache

Conversation

@JustAGhosT

Copy link
Copy Markdown
Collaborator

Summary

  • stop HTTP caching /api/auth/providers so runtime Mystira Identity config changes show immediately
  • fetch auth providers with cache: no-store on login and signup pages

Live finding

The live providers endpoint currently returns Mystira Identity, but it was still serving Cache-Control: public, max-age=300. A prior empty provider response could make the login UI show the stale "Mystira Identity sign-in is not configured" hint even after the App Service config was corrected.

Validation

  • pnpm exec eslint app/api/auth/providers/route.ts app/login/page.tsx app/signup/page.tsx
  • pnpm exec prettier --check app/api/auth/providers/route.ts app/login/page.tsx app/signup/page.tsx
  • pnpm run build
  • pnpm run type-check

@JustAGhosT
JustAGhosT merged commit bfc86ec into main Jul 19, 2026
7 checks passed
@JustAGhosT
JustAGhosT deleted the agent/fix-auth-provider-cache branch July 19, 2026 01:05

@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: b3da6939c7

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

{
headers: {
'Cache-Control': 'public, max-age=300, s-maxage=300',
'Cache-Control': 'no-store, max-age=0',

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 Bypass the provider cache for no-store responses

When an external/OIDC provider list has already been fetched, this endpoint still calls getAvailableProviders(), which returns the process-level providersCache until its 5-minute TTL expires (lib/auth/identity-provider.ts:198, with writes at 215-218 and 262-265). In that scenario, toggling or changing providers in the identity service can still leave login/signup serving stale provider data despite the new no-store HTTP header and client fetch option; only browser/proxy caching is bypassed, not the in-memory provider cache.

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