NEXT_PUBLIC_* vars are baked at Next.js build time but were not available during Docker build (web service had no env_file/build args). Hardcode IDs as fallback in msalConfig.ts, also wire AZURE_AD_* through Dockerfile ARGs and docker-compose build args. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
916 B
TypeScript
29 lines
916 B
TypeScript
import { Configuration, PopupRequest } from '@azure/msal-browser';
|
|
|
|
const TENANT_ID =
|
|
process.env.NEXT_PUBLIC_AZURE_TENANT_ID || 'e519c2e6-bc6d-4fdf-8d9c-923c2f002385';
|
|
const CLIENT_ID =
|
|
process.env.NEXT_PUBLIC_AZURE_CLIENT_ID || '9079054c-9620-4757-a256-23413042f1ef';
|
|
|
|
export const msalConfig: Configuration = {
|
|
auth: {
|
|
clientId: CLIENT_ID,
|
|
authority: `https://login.microsoftonline.com/${TENANT_ID}`,
|
|
redirectUri:
|
|
typeof window !== 'undefined'
|
|
? `${window.location.origin}/ppt-tool/login`
|
|
: 'http://localhost/ppt-tool/login',
|
|
postLogoutRedirectUri:
|
|
typeof window !== 'undefined'
|
|
? `${window.location.origin}/ppt-tool/login`
|
|
: 'http://localhost/ppt-tool/login',
|
|
},
|
|
cache: {
|
|
cacheLocation: 'sessionStorage',
|
|
storeAuthStateInCookie: false,
|
|
},
|
|
};
|
|
|
|
export const loginRequest: PopupRequest = {
|
|
scopes: ['openid', 'profile', 'email'],
|
|
};
|