Login:OAuth2: fix error redirect
This commit is contained in:
parent
2cf00f3e1d
commit
a525c677ef
@ -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") {
|
||||
|
Loading…
Reference in New Issue
Block a user