diff --git a/pages/login.js b/pages/login.js index bf56396..ed26716 100644 --- a/pages/login.js +++ b/pages/login.js @@ -9,8 +9,15 @@ import useAccountRedirect from '~/hooks/useAccountRedirect' export default function Login(){ useAccountRedirect() + const redirectAfterLogin = user => { + if (user.is_admin) + Router.push('/admin') + else + Router.push('/account') + } + return ( - Router.push('/account')}> +

Login

isEmail(value)} hint="Enter a valid email address" /> (value.length >= 8)} hint="Password must be at least 8 characters long" />