From e4d97d077526f6d137c469b713acabe80f77631e Mon Sep 17 00:00:00 2001 From: Pruthvi Prodduturi Date: Fri, 31 Jul 2026 15:35:23 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20demo=20mode=20for=20Vercel=20=E2=80=94?= =?UTF-8?q?=20auto-auth=20when=20backend=20unreachable,=20land=20on=20/abo?= =?UTF-8?q?ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/reference/forge-logo-light.svg | 8 -------- docs/reference/forge-logo.svg | 8 -------- portal/frontend/auth/useAuth.tsx | 10 +++++++--- portal/frontend/vercel.json | 5 +++++ 4 files changed, 12 insertions(+), 19 deletions(-) create mode 100644 portal/frontend/vercel.json diff --git a/docs/reference/forge-logo-light.svg b/docs/reference/forge-logo-light.svg index eb3a0c6..1418d6e 100644 --- a/docs/reference/forge-logo-light.svg +++ b/docs/reference/forge-logo-light.svg @@ -36,12 +36,4 @@ letter-spacing="-2" fill="#0f172a">RGE - - THE CORE DATA PLATFORM diff --git a/docs/reference/forge-logo.svg b/docs/reference/forge-logo.svg index 758403d..5a10e59 100644 --- a/docs/reference/forge-logo.svg +++ b/docs/reference/forge-logo.svg @@ -43,12 +43,4 @@ letter-spacing="-2" fill="url(#text-grad)">RGE - - THE CORE DATA PLATFORM diff --git a/portal/frontend/auth/useAuth.tsx b/portal/frontend/auth/useAuth.tsx index a6d2fa8..86be9b6 100644 --- a/portal/frontend/auth/useAuth.tsx +++ b/portal/frontend/auth/useAuth.tsx @@ -110,13 +110,17 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { token: null, // session cookie — no bearer token needed }); } catch { + // Backend unreachable — enter demo mode so the UI renders + const isDemo = !process.env.NEXT_PUBLIC_API_BASE_URL && typeof window !== "undefined"; setState({ isConnecting: false, - isAuthenticated: false, + isAuthenticated: isDemo, noAccess: false, provider: "azure_ad", - user: null, - role: null, + user: isDemo + ? { name: "Demo User", email: "demo@forge.dev", initials: "DU" } + : null, + role: isDemo ? "Viewer" : null, token: null, }); } diff --git a/portal/frontend/vercel.json b/portal/frontend/vercel.json new file mode 100644 index 0000000..92fdadc --- /dev/null +++ b/portal/frontend/vercel.json @@ -0,0 +1,5 @@ +{ + "rewrites": [ + { "source": "/", "destination": "/about" } + ] +}