From 7453d3a8210dec269a351932c6c21a4eff324469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Gonz=C3=A1lez?= Date: Wed, 17 Apr 2024 15:58:41 +0200 Subject: [PATCH] redirects correctly after signing --- client/src/pages/auth/signin.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/src/pages/auth/signin.tsx b/client/src/pages/auth/signin.tsx index ddcce85aa..ef34decd9 100644 --- a/client/src/pages/auth/signin.tsx +++ b/client/src/pages/auth/signin.tsx @@ -11,6 +11,7 @@ import toast from 'react-hot-toast'; import AuthenticationLayout from 'layouts/authentication'; import { Label, Input, Checkbox } from 'components/forms'; import { Button } from 'components/button'; +import { env } from '@/env.mjs'; import type { ReactElement } from 'react'; import type { NextPageWithLayout } from 'pages/_app'; @@ -44,9 +45,14 @@ const SignIn: NextPageWithLayout = () => { }); if (ok) { - router.push((router.query?.callbackUrl as string) || '/analysis/map', undefined, { - shallow: true, - }); + router.push( + (router.query?.callbackUrl as string) || + (env.NEXT_PUBLIC_ENABLE_EUDR ? '/eudr' : '/analysis/map'), + undefined, + { + shallow: true, + }, + ); } else { setIsLoading(false); toast.error('Login failed. Your email or password is incorrect.');