Skip to content

Commit 613af28

Browse files
feat: added auth to main page
1 parent 91f17b2 commit 613af28

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

frontend/src/pages/MainPage.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
import { useEffect } from "react";
12
import { Header } from "../components/Common/Common";
3+
import { OAUTH_LOGIN_URL, useAuthContext } from "../utils/auth";
24

35
function MainPage() {
6+
const auth = useAuthContext();
7+
8+
useEffect(() => {
9+
if (!auth.isAuthenticated) {
10+
window.location.assign(OAUTH_LOGIN_URL);
11+
}
12+
}, []);
13+
414
return <>
515
<Header
616
title="MetaKGP Maintainers' Dashboard"

0 commit comments

Comments
 (0)