mirror of https://gitee.com/answerdev/answer.git
feat(router-guard): set route guard for activation/* and confirm-new-email
This commit is contained in:
parent
a801ff6cda
commit
e2cf6d2b3d
|
@ -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();
|
||||
},
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue