fix(guard): Supplementary `IGNORE_PATH_LIST`

This commit is contained in:
haitaoo 2023-04-25 13:16:37 +08:00
parent d672e31815
commit 5a4c22c393
4 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,6 @@ const Index: FC = () => {
const navigate = useNavigate();
useEffect(() => {
const token = searchParams.get('access_token');
alert(`landing: ${token}`);
guard.handleLoginWithToken(token, navigate);
}, []);
usePageTags({

View File

@ -11,4 +11,6 @@ export const RouteAlias = {
activationFailed: '/users/account-activation/failed',
suspended: '/users/account-suspended',
confirmNewEmail: '/users/confirm-new-email',
confirmEmail: '/users/confirm-email',
authLanding: '/users/auth-landing',
};

View File

@ -33,7 +33,6 @@ const routes: RouteNode[] = [
guard: () => {
const gr = guard.shouldLoginRequired();
if (!gr.ok) {
alert(`LoginRequired: ${window.location.pathname}`);
return gr;
}
return guard.notForbidden();

View File

@ -89,6 +89,8 @@ export const IGNORE_PATH_LIST = [
RouteAlias.passwordReset,
RouteAlias.accountActivation,
RouteAlias.confirmNewEmail,
RouteAlias.confirmEmail,
RouteAlias.authLanding,
'/user-center/',
];
@ -339,7 +341,6 @@ export const handleLoginWithToken = (
getLoggedUserInfo().then((res) => {
loggedUserInfoStore.getState().update(res);
const userStat = deriveLoginState();
alert(`userStat: ${JSON.stringify(userStat)}`);
if (userStat.isNotActivated) {
floppyNavigation.navigate(RouteAlias.inactive, {
handler,