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);