Login:OAuth2: fix error redirect

This commit is contained in:
Timofey Boyko 2023-11-23 10:43:10 +03:00
parent 2cf00f3e1d
commit a525c677ef

View File

@ -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") {