Explorar el Código

redirect after login

reiji-h hace 1 año
padre
commit
4766b2035d
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      apps/app/src/pages/login/index.page.tsx

+ 2 - 0
apps/app/src/pages/login/index.page.tsx

@@ -127,6 +127,8 @@ async function injectServerConfigurations(context: GetServerSidePropsContext, pr
 export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
 export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
   const result = await getServerSideCommonProps(context);
   const result = await getServerSideCommonProps(context);
 
 
+  (context.req as CrowiRequest).session.redirectTo = context.req.headers.referer;
+
   // check for presence
   // check for presence
   // see: https://github.com/vercel/next.js/issues/19271#issuecomment-730006862
   // see: https://github.com/vercel/next.js/issues/19271#issuecomment-730006862
   if (!('props' in result)) {
   if (!('props' in result)) {