diff --git a/src/hooks/auth.js b/src/hooks/auth.js index be080aab..667f92fc 100644 --- a/src/hooks/auth.js +++ b/src/hooks/auth.js @@ -102,6 +102,10 @@ export const useAuth = ({ middleware, redirectIfAuthenticated } = {}) => { useEffect(() => { if (middleware === 'guest' && redirectIfAuthenticated && user) router.push(redirectIfAuthenticated) + + if (middleware === 'auth' && !user?.email_verified_at) + router.push('/verify-email') + if ( window.location.pathname === '/verify-email' && user?.email_verified_at