diff --git a/packages/dashboard/src/pages/api/accounts/authenticate.js b/packages/dashboard/src/pages/api/accounts/authenticate.js index 37ac3f5d..b48b75b3 100644 --- a/packages/dashboard/src/pages/api/accounts/authenticate.js +++ b/packages/dashboard/src/pages/api/accounts/authenticate.js @@ -7,12 +7,12 @@ export default async (req, res) => { try { const auth = await superagent - .get("http://oathkeeper:4455/user") + .get("http://oathkeeper:4455/login") .set("cookie", `ory_kratos_session=${req.cookies.ory_kratos_session}`); res.setHeader("Set-Cookie", auth.header["set-cookie"]); } catch (error) { - res.redirect(302, "/error"); // credentials were correct but accounts service failed + res.redirect(302, "/auth/login"); // credentials were correct but accounts service failed } res.redirect(302, req.query.return_to ?? "/"); diff --git a/packages/dashboard/src/pages/error.js b/packages/dashboard/src/pages/error.js index e2888a2f..19a1e7b1 100644 --- a/packages/dashboard/src/pages/error.js +++ b/packages/dashboard/src/pages/error.js @@ -11,7 +11,7 @@ export async function getServerSideProps(context) { if (!error || typeof error !== "string") { console.log("No error ID found in URL, redirecting to homepage."); - return { redirect: { permanent: false, destination: config.kratos.browser } }; + return { redirect: { permanent: false, destination: "/" } }; } try { @@ -21,7 +21,7 @@ export async function getServerSideProps(context) { throw new Error(`Expected error ${error} to contain "errors" but got ${JSON.stringify(data)}`); } catch (error) { - return { redirect: { permanent: false, destination: config.kratos.browser } }; + return { redirect: { permanent: false, destination: "/" } }; } }