Fix Authentication
This commit is contained in:
@@ -26,7 +26,7 @@ export default function AuthGuard({ children }: AuthGuardProps) {
|
||||
if (pathname !== requestedLocation) {
|
||||
setRequestedLocation(pathname);
|
||||
}
|
||||
return <Login />;
|
||||
return <Navigate to="/auth/login" replace={true}/>;
|
||||
}
|
||||
|
||||
if (requestedLocation && pathname !== requestedLocation) {
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function GuestGuard({ children }: GuestGuardProps) {
|
||||
const { isAuthenticated } = useAuth();
|
||||
|
||||
if (isAuthenticated) {
|
||||
return <Navigate to={'/dashboard'} />;
|
||||
return <Navigate to={'/dashboard'} replace={true}/>;
|
||||
}
|
||||
|
||||
return <>{children}</>;
|
||||
|
||||
Reference in New Issue
Block a user