Revert "V1_GTA"

This reverts commit 881476122c.
This commit is contained in:
2025-12-02 17:50:31 +01:00
parent 0dc7125688
commit 6f75a66906
54 changed files with 5645 additions and 7619 deletions

View File

@@ -1,47 +1,22 @@
// authConfig.js
const hostname = window.location.hostname;
const protocol = window.location.protocol;
// Détection environnements (utile pour le debug)
const isProduction = hostname === "mygta.ensup-adm.net";
// --- API URL ---
// On utilise TOUJOURS /api car le proxy Vite (port 80) va rediriger vers le backend (port 3000)
// Cela évite les problèmes CORS et les problèmes de ports fermés (8000)
export const API_BASE_URL = "/api";
// --- MSAL Config ---
export const msalConfig = {
auth: {
clientId: "4bb4cc24-bac3-427c-b02c-5d14fc67b561",
authority: "https://login.microsoftonline.com/9840a2a0-6ae1-4688-b03d-d2ec291be0f9",
// En prod, on force l'URL sans slash final pour être propre
redirectUri: isProduction
? "https://mygta.ensup-adm.net"
: `${protocol}//${hostname}`,
clientId: "4bb4cc24-bac3-427c-b02c-5d14fc67b561", // Application (client) ID dans Azure
authority: "https://login.microsoftonline.com/9840a2a0-6ae1-4688-b03d-d2ec291be0f9", // Directory (tenant) ID
redirectUri: "http://localhost:5173"
},
cache: {
cacheLocation: "sessionStorage",
cacheLocation: "sessionStorage",
storeAuthStateInCookie: false,
},
}
};
// --- Permissions Graph ---
export const loginRequest = {
scopes: [
"User.Read",
"User.Read.All",
"Group.Read.All",
"GroupMember.Read.All",
"Mail.Send",
],
"User.Read.All", // Pour lire les profils des autres utilisateurs
"Group.Read.All", // Pour lire les groupes
"GroupMember.Read.All", // Pour lire les membres des groupes
"Mail.Send" //Envoyer les emails.
]
};
console.log("🔧 Config Auth:", {
hostname,
protocol,
API_BASE_URL,
redirectUri: msalConfig.auth.redirectUri,
});