Rewg Fix 2
All checks were successful
Client Tech / build-deploy (push) Successful in 11s

This commit is contained in:
Grae Jones
2026-03-23 14:10:25 -07:00
parent d8dda59f4c
commit 7925b45d76
2 changed files with 13 additions and 27 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,30 +1,17 @@
/** /**
* authConfig.js — Tech Client (Staff Plane) * authConfig.js — Tech Client (Staff Plane)
*
* ┌─────────────────────────────────────────────────────────────────────────┐
* │ PRODUCTION MIGRATION — only these values change at handoff: │
* │ │
* │ STAFF_AUTHORITY → 'https://login.microsoftonline.com/{ORG_TENANT}' │
* │ STAFF_TENANT_ID → new company org tenant ID │
* │ STAFF_CLIENT_ID → staff app registration in org tenant │
* │ │
* │ No other code changes required anywhere. │
* └─────────────────────────────────────────────────────────────────────────┘
*
* DEV NOTE: Staff currently authenticate against the CIAM tenant (same as
* clients) because no org tenant exists yet. The login screen looks identical
* to the client login — this is cosmetic only. API isolation is enforced by
* audience: staff tokens are rejected by Gateway, client tokens by Management.
*/ */
// ── Staff Identity Config ───────────────────────────────────────────────────── // ── Staff Identity Config ─────────────────────────────────────────────────────
const STAFF_TENANT_ID = 'f56a3c51-9b5c-4356-920f-b4dcf932a96b'; const STAFF_TENANT_ID = 'f56a3c51-9b5c-4356-920f-b4dcf932a96b';
const STAFF_CLIENT_ID = '217928a9-4591-4dff-9f09-5b233824cf4f'; const STAFF_CLIENT_ID = '217928a9-4591-4dff-9f09-5b233824cf4f';
// PROD: swap to → 'https://login.microsoftonline.com/' + STAFF_TENANT_ID
const STAFF_AUTHORITY = 'https://login.microsoftonline.com/' + STAFF_TENANT_ID; const STAFF_AUTHORITY = 'https://login.microsoftonline.com/' + STAFF_TENANT_ID;
// Management Staff API — resource the Tech SPA requests a token for
const MGMT_APP_ID = 'af95fa13-2ef4-4911-b137-7acc6a784cfa';
// ── MSAL Config ─────────────────────────────────────────────────────────────── // ── MSAL Config ───────────────────────────────────────────────────────────────
export const msalConfig = { export const msalConfig = {
@@ -33,10 +20,10 @@ export const msalConfig = {
authority: STAFF_AUTHORITY, authority: STAFF_AUTHORITY,
redirectUri: window.location.origin, redirectUri: window.location.origin,
postLogoutRedirectUri: window.location.origin, postLogoutRedirectUri: window.location.origin,
navigateToLoginRequestUrl: true, navigateToLoginRequestUrl: false, // ← was true, caused the loop
}, },
cache: { cache: {
cacheLocation: 'sessionStorage', cacheLocation: 'sessionStorage',
storeAuthStateInCookie: false, storeAuthStateInCookie: false,
}, },
system: { system: {
@@ -50,19 +37,18 @@ export const msalConfig = {
case 3: console.debug(message); break; case 3: console.debug(message); break;
} }
}, },
logLevel: 3, logLevel: 1, // warn + error only in prod
}, },
}, },
}; };
export const loginRequest = { export const loginRequest = {
scopes: ["api://4e4d69c3-558a-4a27-a689-17bd397175e5/access_as_user"] scopes: [`api://${MGMT_APP_ID}/access_as_user`] // ← fixed
}; };
// ── API Endpoints ───────────────────────────────────────────────────────────── // ── API Endpoints ─────────────────────────────────────────────────────────────
export const API_BASE = 'https://adpapi.usimdev.com'; // Gateway API export const API_BASE = 'https://portal.positivespend.com'; // ← fixed
export const MGMT_BASE = 'https://adpmgmt.usimdev.com'; // Management API export const MGMT_BASE = 'https://mgmt.positivespend.com'; // ← fixed
// Legacy — kept for backward compatibility with apiClient.js export const SESSION_ENDPOINT = `${API_BASE}/api/auth/session`;
export const SESSION_ENDPOINT = `${API_BASE}/api/auth/session`;