Repository navigation
Conversation
The API is removing the apiOauthSignIn mutation and api_oauth sign-in (CruGlobal/mpdx_api#3844), so this provider can no longer sign anyone in. The API saw no api_oauth or apiOauthSignIn sign-ins in about a week of prod logs, and every environment signs in with Okta. - Drop the apioauth next-auth provider, its env checks and its apiOauthSignIn call, and the hand-committed apiOauthSignIn.ts. - AUTH_PROVIDER must now be OKTA; anything else still fails at startup. - Drop the API_OAUTH_* env defaults and secret from next.config.ts, the "Sign In with SSO" button text, and the README and CLAUDE.md docs. - Delete the API_OAUTH login test, add a test for the auth route's startup guards, and pin the Okta button text exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Preview branch generated at https://MPDX-10415.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against c8a4738 No significant changes found |
|
🤖 agent-review · ✅ no blockers · risk CRITICAL · 👤 needs a person BLOCKERS: fix or dismiss to pass✅ No blockers. 👤 Needs a person's approval: PCI path: CLAUDE.md; PCI path: next.config.ts; PCI path: pages/api/auth/[...nextauth].page.test.ts; PCI path: pages/api/auth/[...nextauth].page.ts; PCI path: pages/api/auth/apiOauthSignIn.ts. The bot will not approve this PR. OTHER FINDINGS (14)
🔧 Fix suggestions (0)No automated fixes for this review. 📦 Dependency impactBlast radius: 0 files. None of the changed files has an importer in the index (the sign-in route and the login page are Next.js entry points). 📊 Review detail & statsGenerated: 2026-12-01T17:40:42Z · Day: Tuesday · Files changed: 9 (+117 -415 lines) in the whole PR; this pass 4 (+53 -52) Risk factors detected: config_security_change (next.config.ts, whole PR); sign-in code under pages/api/auth/ and pages/login.page.tsx; scope single_feature for this pass; paths not in the risk map: CLAUDE.md, README.md Deterministic evidence:
Agent summary for this pass (bands: Critical 9-10 · High 7-8 · Important 5-6 · Suggestions 3-4):
Three of this pass's findings ( Per-agent perspectives on blockers: none (no blockers). Engine: code-review (from config) · effort xhigh (from config) · model opus (from config)
Review quality:
💬 How to act on this reviewEvery finding above is numbered. Severity ≥ 7 findings carry a checkbox and must each be fixed or |
|
@jeff-clay could you review and approve this PR? Here's what it does and why it needs a person. What it does: the MPDX web app had two ways to sign in: Okta, and an older option called API OAuth. Only Okta is turned on, on both mpdx.org and stage. This PR takes the old option out of the web app. The matching API change, CruGlobal/mpdx_api#3844, removes the API's half of it, plus an old SAML sign-in (an older single sign-on method) that only returns a server error today. Users won't see a difference: they keep signing in with Okta, and the button just says "Sign In". The help desk MCP sign-in isn't affected; on mpdx.org it already uses the Okta sign-in page. Why: a sign-in path nobody uses is still a way in, and it's code someone has to keep safe. Removing it leaves one path to protect. If a server were ever set up with the old option, sign-in now stops with a clear error in the server logs instead of using it. Why it needs a person: this repo treats sign-in code as a "one-way door." A mistake there could show one person's data to someone else or leak a secret, and that can't be taken back. That's why the review bot marks this PR as critical risk and won't approve it on its own: a code owner has to. I opened the PR, so I can't approve it myself. Already checked: CI is green, and the automated review found no blockers. This PR and #3844 can merge in either order. |
|
The code looks good to me. Two things before I approve:
Small things, none blocking:
Once the preview loads I'll do the Okta sign-in check and approve. |
|
Preview branch generated at https://MPDX-10415.d3dytjb8adxkk5.amplifyapp.com |
The startup guard already stops the server unless AUTH_PROVIDER is OKTA, so the later AUTH_PROVIDER === 'OKTA' checks were always true. The Okta provider is now always configured, sign out always goes to the Okta sign-out URL, and the login page signs in with the 'okta' provider id directly instead of deriving it from AUTH_PROVIDER. The isOkta and signInAuthProviderId props are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Links
Description
The API is removing api_oauth sign-in and the
apiOauthSignInGraphQL mutation in CruGlobal/mpdx_api#3844. That makes this app'sAUTH_PROVIDER=API_OAUTHoption dead, so this PR removes it. Okta sign-in does not change.pages/api/auth/[...nextauth].page.ts: drop theapioauthprovider, itsAPI_OAUTH_*env checks, and theapiOauthSignIncall in the sign-in callback. TheAUTH_PROVIDERstartup guard now accepts onlyOKTA. The Okta provider, its env guard, theoktaSignInpath, and the JWT and session callbacks are unchanged.pages/api/auth/apiOauthSignIn.ts, the hand-committed generated file for the removed mutation.next.config.ts: drop theAPI_OAUTH_*env defaults and theAPI_OAUTH_CLIENT_SECRETline in the secrets block.JWT_SECRET,OKTA_CLIENT_SECRETandROLLBAR_SERVER_ACCESS_TOKENstill parse as before.pages/login.page.tsx: the button always reads "Sign In", which is what Okta users already saw. The "Sign In with SSO" text is gone.pages/login-apioauth.page.test.tsx. Addpages/api/auth/[...nextauth].page.test.ts, which checks that the route loads withOKTAand throws on any otherAUTH_PROVIDERvalue or a missingOKTA_*variable. Both kinds of case fail with main's guards put back.pages/login.page.test.tsxnow matches the button name "Sign In" exactly. The old/sign in/ialso matched "Sign In with SSO".Why it is safe: the API saw no
api_oauthorapiOauthSignInsign-ins in about 7 days of prod logs, andAUTH_PROVIDERdefaults toOKTAinnext.config.ts.Depends on: none. This can merge before or after CruGlobal/mpdx_api#3844. The API_OAUTH path already needs an API-side OAuth app, and prod and stage have none for it.
Not in this PR:
.claude/review/rules/security.mdandapi-contracts.mdstill describe the API_OAUTH provider. Review rules change in their own PR.scripts/jest-shards/timings.jsonkeeps its entry for the deleted test until the next timings refresh.Testing
AI review
Findings I did not fix, and why:
Checklist:
MPDX-1234 Add sortable columns)/agent-review:reviewcommand locally and fixed each finding or listed it abovegithub-actionsbot has approved the PR (it approves once/agent-review:reviewleaves no open blockers; it never approves a one-way door).github/CODEOWNERSgives an owner)🤖 Generated with Claude Code