Made it so users have to verify their e-mail starting to use the application
This commit is contained in:
@@ -16,9 +16,9 @@ export default function useUser({redirectTo = "", redirectIfFound = false} = {})
|
||||
|
||||
if (
|
||||
// If redirectTo is set, redirect if the user was not found.
|
||||
(redirectTo && !redirectIfFound && !user) ||
|
||||
(redirectTo && !redirectIfFound && (!user || (user && !user.isVerified))) ||
|
||||
// If redirectIfFound is also set, redirect if the user was found
|
||||
(redirectIfFound && user)
|
||||
(redirectIfFound && user && user.isVerified)
|
||||
) {
|
||||
Router.push(redirectTo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user