- main.jsx: always initialize MSAL with initialize() before rendering (MSAL v3 requirement) - main.jsx: always wrap with MsalProvider regardless of SSO toggle - AppContent.jsx: only show login gate when isSSOEnabled() is true - LoginPage.jsx: switch loginPopup → loginRedirect for incognito compatibility - authConfig.js: add navigateToLoginRequestUrl: false - api.php: set_time_limit(120) to prevent Imagen 3 timeout - video_api.php: set_time_limit(300) to prevent Veo polling timeout - CLAUDE.md: fix IndexedDB schema, add AppContent/MSAL pattern, Vite proxy routes, missing packages Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
26 lines
690 B
JavaScript
26 lines
690 B
JavaScript
/**
|
|
* MSAL Authentication Configuration
|
|
* Uses environment variables for flexible deployment
|
|
*/
|
|
|
|
export const msalConfig = {
|
|
auth: {
|
|
clientId: import.meta.env.VITE_SSO_CLIENT_ID || '',
|
|
authority: `https://login.microsoftonline.com/${import.meta.env.VITE_SSO_TENANT_ID || 'common'}`,
|
|
redirectUri: import.meta.env.VITE_SSO_REDIRECT_URI || window.location.origin,
|
|
navigateToLoginRequestUrl: false,
|
|
},
|
|
cache: {
|
|
cacheLocation: 'sessionStorage',
|
|
storeAuthStateInCookie: false,
|
|
}
|
|
};
|
|
|
|
export const loginRequest = {
|
|
scopes: ['User.Read']
|
|
};
|
|
|
|
// Check if SSO is enabled
|
|
export const isSSOEnabled = () => {
|
|
return import.meta.env.VITE_SSO_ENABLED === 'true';
|
|
};
|