aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/Navigation.tsx4
-rw-r--r--frontend/src/components/ProtectedRoute.tsx4
2 files changed, 4 insertions, 4 deletions
diff --git a/frontend/src/components/Navigation.tsx b/frontend/src/components/Navigation.tsx
index 4d41d32..4be54a7 100644
--- a/frontend/src/components/Navigation.tsx
+++ b/frontend/src/components/Navigation.tsx
@@ -10,7 +10,7 @@ import { useAuth } from "../contexts/AuthContext";
import { MenuItem } from "./MenuItem";
export function Navigation() {
- const { logout, user } = useAuth();
+ const { logout, isLoggedIn } = useAuth();
const [, setLocation] = useLocation();
const handleLogout = async () => {
@@ -29,7 +29,7 @@ export function Navigation() {
<MenuItem path="/unread" label="Unread" icon={faBookOpen} />
<MenuItem path="/read" label="Read" icon={faCircleCheck} />
<MenuItem path="/settings" label="Settings" icon={faGear} />
- {user && (
+ {isLoggedIn && (
<button
type="button"
onClick={handleLogout}
diff --git a/frontend/src/components/ProtectedRoute.tsx b/frontend/src/components/ProtectedRoute.tsx
index 0cfef42..206e5c5 100644
--- a/frontend/src/components/ProtectedRoute.tsx
+++ b/frontend/src/components/ProtectedRoute.tsx
@@ -7,7 +7,7 @@ interface Props {
}
export function ProtectedRoute({ children }: Props) {
- const { user, isLoading } = useAuth();
+ const { isLoggedIn, isLoading } = useAuth();
if (isLoading) {
return (
@@ -24,7 +24,7 @@ export function ProtectedRoute({ children }: Props) {
);
}
- if (!user) {
+ if (!isLoggedIn) {
return <Redirect to="/login" />;
}