Skip to content

Commit 273f51d

Browse files
committed
Update API for signin and signup, modify navbar to display login status
- Changed the API for sign-in and sign-out functionalities - Edited the navbar to show login status
1 parent dcd5892 commit 273f51d

File tree

9 files changed

+545
-21
lines changed

9 files changed

+545
-21
lines changed

authentication-service/.env.dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MONGODB_URI=mongodb+srv://cs3219g11:[email protected]/?retryWrites=true&w=majority&appName=Cluster0
2+
JWT_SECRET_KEY="01zWaHku91RQPaP0s68s7Xd1J1hGOn+hhR0H0FKzyPw="
3+
PORT=4040

peerprep-fe/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"dependencies": {
1414
"@radix-ui/react-checkbox": "^1.1.1",
1515
"@radix-ui/react-dialog": "^1.1.1",
16+
"@radix-ui/react-dropdown-menu": "^2.1.2",
1617
"@radix-ui/react-icons": "^1.3.0",
1718
"@radix-ui/react-popover": "^1.1.1",
1819
"@radix-ui/react-select": "^2.1.1",

peerprep-fe/pnpm-lock.yaml

Lines changed: 223 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
'use client';
12
import LoggedIn from './components/LoggedIn';
23
import LandingPage from './components/LandingPage';
4+
import { useAuth } from '@/hooks/useAuth';
35

46
// TODO: Replace with actual authentication logic
57
// change this to false to see landing page
68
const isLoggedIn = true;
79

810
export default function Home() {
9-
return isLoggedIn ? <LoggedIn /> : <LandingPage />;
11+
const { isAuthenticated, logout } = useAuth();
12+
if (!isAuthenticated) {
13+
return <LandingPage />;
14+
} else {
15+
return <LoggedIn />;
16+
}
1017
}

0 commit comments

Comments
 (0)