diff --git a/packages/login/src/server/index.ts b/packages/login/src/server/index.ts index 41480df3ab..b8607e4133 100644 --- a/packages/login/src/server/index.ts +++ b/packages/login/src/server/index.ts @@ -70,10 +70,16 @@ app.get("*", async (req: ILoginRequest, res: Response, next) => { initSSR(headers); try { - const oauthClientId = (query.client_id as string) || ""; + const oauthClientId = + (query.client_id as string) || (query.clientId as string) || ""; const isOAuth = query.type === "oauth2" && !!oauthClientId; + if (isOAuth && oauthClientId === "error") { + res.redirect("/login/error"); + return next(); + } + const isAuth = await checkIsAuthenticated(); if (isAuth && !isOAuth && url !== "/login/error") {