feat(router-guard): set route guard for activation/* and confirm-new-email

This commit is contained in:
haitao(lj) 2022-10-31 10:34:51 +08:00
parent a801ff6cda
commit e2cf6d2b3d
2 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,6 @@ import {
pullLoggedUser,
isLoggedAndNormal,
isAdminLogged,
isLogged,
isNotLogged,
isNotLoggedOrNormal,
isLoggedAndInactive,
@ -14,9 +13,6 @@ const RouteGuarder = {
base: async () => {
return isNotLoggedOrNormal();
},
logged: async () => {
return isLogged();
},
notLogged: async () => {
return isNotLogged();
},

View File

@ -126,9 +126,11 @@ const routes: RouteNode[] = [
page: 'pages/Users/PasswordReset',
guard: RouteGuarder.loggedAndNormal,
},
// TODO: guard '/account-activation/*', '/users/confirm-new-email'
{
path: 'users/account-activation',
page: 'pages/Users/ActiveEmail',
guard: RouteGuarder.loggedAndInactive,
},
{
path: 'users/account-activation/success',
@ -145,6 +147,7 @@ const routes: RouteNode[] = [
{
path: '/users/account-suspended',
page: 'pages/Users/Suspended',
guard: RouteGuarder.loggedAndSuspended,
},
// for admin
{