From a343a7cf54b64520d245f4a2b0d74fe55ad7134f Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Tue, 16 Feb 2021 13:04:18 +0100 Subject: [PATCH] registration --- packages/dashboard/src/pages/auth/registration.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/src/pages/auth/registration.js b/packages/dashboard/src/pages/auth/registration.js index 7c098000..88502591 100644 --- a/packages/dashboard/src/pages/auth/registration.js +++ b/packages/dashboard/src/pages/auth/registration.js @@ -8,6 +8,7 @@ const kratos = new PublicApi(new Configuration({ basePath: config.kratos.public export async function getServerSideProps(context) { const flow = context.query.flow; + const redirect = encodeURIComponent(`/api/accounts/login?return_to=${context.query.return_to ?? "/"}`); if (process.env.NODE_ENV === "development") { return { props: { flow: require("../../../stubs/registration.json") } }; @@ -21,7 +22,7 @@ export async function getServerSideProps(context) { return { redirect: { permanent: false, - destination: `${config.kratos.browser}/self-service/registration/browser`, + destination: `${config.kratos.browser}/self-service/registration/browser?return_to=${redirect}`, }, }; } @@ -36,7 +37,7 @@ export async function getServerSideProps(context) { return { redirect: { permanent: false, - destination: `${config.kratos.browser}/self-service/registration/browser`, + destination: `${config.kratos.browser}/self-service/registration/browser?return_to=${redirect}`, }, }; }