test
This commit is contained in:
parent
c2a3840f89
commit
59130cc4d5
|
@ -7,14 +7,11 @@ export default async (req, res) => {
|
||||||
.post("http://oathkeeper:4455/login")
|
.post("http://oathkeeper:4455/login")
|
||||||
.set("cookie", `ory_kratos_session=${req.cookies.ory_kratos_session}`);
|
.set("cookie", `ory_kratos_session=${req.cookies.ory_kratos_session}`);
|
||||||
|
|
||||||
console.log("auth.header", auth.header);
|
|
||||||
res.setHeader("Set-Cookie", auth.header["set-cookie"]);
|
res.setHeader("Set-Cookie", auth.header["set-cookie"]);
|
||||||
res.redirect(req.query.return_to ?? "/");
|
res.redirect(req.query.return_to ?? "/");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("error", error);
|
// credentials were correct but accounts service failed
|
||||||
|
res.redirect("/.ory/kratos/public/self-service/browser/flows/logout");
|
||||||
// res.redirect(302, "/auth/login"); // credentials were correct but accounts service failed
|
|
||||||
res.redirect("/"); // credentials were correct but accounts service failed
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res.redirect("/auth/login"); // redirect to login page if kratos session is missing
|
res.redirect("/auth/login"); // redirect to login page if kratos session is missing
|
||||||
|
|
Reference in New Issue