mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +02:00
Fix action item check if not authenticated
This commit is contained in:
@@ -34,7 +34,11 @@ export const AppOutlet = ({ redirectTo }: PrivateOutletProps) => {
|
||||
const actions = [isServerRequired, isCredentialRequired, isMpvRequired];
|
||||
const actionRequired = actions.some((c) => c);
|
||||
|
||||
if (actionRequired) {
|
||||
if (isAuthenticated) {
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
if (isAuthenticated && actionRequired) {
|
||||
return (
|
||||
<Navigate
|
||||
replace
|
||||
@@ -44,10 +48,6 @@ export const AppOutlet = ({ redirectTo }: PrivateOutletProps) => {
|
||||
);
|
||||
}
|
||||
|
||||
if (isAuthenticated) {
|
||||
return <Outlet />;
|
||||
}
|
||||
|
||||
logout();
|
||||
return <Navigate replace state={{ from: location }} to={redirectTo} />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user