From 8a02125fe2a89197182599424022cafa37b82659 Mon Sep 17 00:00:00 2001 From: Manus Date: Sun, 3 May 2026 06:00:18 -0400 Subject: [PATCH] fix: getLoginUrl() returns /login when VITE_OAUTH_PORTAL_URL is not set --- client/src/const.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/const.ts b/client/src/const.ts index 9999063..7a84981 100644 --- a/client/src/const.ts +++ b/client/src/const.ts @@ -4,6 +4,13 @@ export { COOKIE_NAME, ONE_YEAR_MS } from "@shared/const"; export const getLoginUrl = () => { const oauthPortalUrl = import.meta.env.VITE_OAUTH_PORTAL_URL; const appId = import.meta.env.VITE_APP_ID; + + // If OAuth portal URL is not configured (e.g. self-hosted / recette without Manus OAuth), + // fall back to the local login page instead of constructing an invalid URL. + if (!oauthPortalUrl || !appId) { + return "/login"; + } + const redirectUri = `${window.location.origin}/api/oauth/callback`; const state = btoa(redirectUri);