import { LogLevel } from '@azure/msal-browser';

// 1. MSAL Configuration (msalConfig)
export const msalConfig = {
    auth: {
        // Application (client) ID of your React SPA from Azure Portal
        clientId: "d82560a8-8fac-401d-9173-10668acb7dfa", 
        // Authority URL (e.g., https://login.microsoftonline.com/YOUR_TENANT_ID)
        authority: "https://login.microsoftonline.com/cb3fc669-059d-4f8c-85eb-5c6564032c53", 
        // Must match the Redirect URI set in the Azure Portal
        redirectUri: "http://localhost:3000/client",
    },
    cache: {
        cacheLocation: "sessionStorage", // Recommended location
        storeAuthStateInCookie: false,
    },
    system: {
        loggerOptions: {
            loggerCallback: (level, message, containsPii) => {
                if (containsPii) { return; }
                if (level === LogLevel.Error) { console.error(message); }
            },
            piiLoggingEnabled: false,
            logLevel: LogLevel.Warning,
        }
    }
};

// 2. Scopes for your Spring Boot API (loginRequest)
export const loginRequest = {
    // This scope tells Azure AD that you want permission to call your API
    // The scope is typically your API's App ID URI + '/.default'
    scopes: ["api://d82560a8-8fac-401d-9173-10668acb7dfa/.default"] 
};