mirror of https://gitee.com/answerdev/answer.git
fix(guard): Supplementary `IGNORE_PATH_LIST`
This commit is contained in:
parent
d672e31815
commit
5a4c22c393
|
@ -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({
|
||||
|
|
|
@ -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',
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue