Explorar o código

Direct access to '/forgot-password-errors' redirects to '/'

Shun Miyazawa %!s(int64=3) %!d(string=hai) anos
pai
achega
fa39c2eb19
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      packages/app/src/pages/forgot-password-errors.page.tsx

+ 10 - 0
packages/app/src/pages/forgot-password-errors.page.tsx

@@ -41,6 +41,16 @@ export const getServerSideProps: GetServerSideProps = async(context: GetServerSi
     props.errorCode = errorCode;
   }
 
+  // Direct access to '/forgot-password-errors' redirects to '/'
+  if (props.errorCode == null) {
+    return {
+      redirect: {
+        permanent: false,
+        destination: '/',
+      },
+    };
+  }
+
   await injectNextI18NextConfigurations(context, props, ['translation']);
 
   return {