diff --git a/.env.example b/.env.example index 9d3797f..ba78f4f 100644 --- a/.env.example +++ b/.env.example @@ -4,9 +4,9 @@ # ── Server deployment ────────────────────────────────────────────────────────── VITE_AZURE_TENANT_ID=e519c2e6-bc6d-4fdf-8d9c-923c2f002385 VITE_AZURE_CLIENT_ID=9079054c-9620-4757-a256-23413042f1ef -VITE_AZURE_REDIRECT_URI=https://ai-sandbox.oliver.solutions/lusa-Back-Planner/ +VITE_AZURE_REDIRECT_URI=https://ai-sandbox.oliver.solutions/lusa-Back-Planner # ── Local development ────────────────────────────────────────────────────────── # VITE_AZURE_TENANT_ID=e519c2e6-bc6d-4fdf-8d9c-923c2f002385 # VITE_AZURE_CLIENT_ID=15c0c4e2-bac0-4564-a3a6-c2717f00a6d9 -# VITE_AZURE_REDIRECT_URI=http://localhost:3000/ +# VITE_AZURE_REDIRECT_URI=http://localhost:8888/lusa-Back-Planner diff --git a/src/components/AuthGuard.tsx b/src/components/AuthGuard.tsx index 353bea9..2add342 100644 --- a/src/components/AuthGuard.tsx +++ b/src/components/AuthGuard.tsx @@ -1,11 +1,9 @@ -import { ReactNode, useEffect, useState } from "react"; +import { ReactNode } from "react"; import { - MsalProvider, AuthenticatedTemplate, UnauthenticatedTemplate, useMsal, } from "@azure/msal-react"; -import { IPublicClientApplication } from "@azure/msal-browser"; import { loginRequest } from "@/lib/msal-config"; function LoginPage() { @@ -47,33 +45,16 @@ function LoginPage() { } interface AuthGuardProps { - instance: IPublicClientApplication; children: ReactNode; } -export default function AuthGuard({ instance, children }: AuthGuardProps) { - const [isReady, setIsReady] = useState(false); - - useEffect(() => { - instance.initialize().then(() => { - instance.handleRedirectPromise().then(() => setIsReady(true)); - }); - }, [instance]); - - if (!isReady) { - return ( -