Skip to content

Commit

Permalink
modify: isLoggedIn 상태 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dabin-Hailey committed Jan 19, 2024
1 parent 60b23da commit 07767a5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/routes/PrivateRouter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { Navigate } from 'react-router-dom';

import { Layout } from '@components/common';
import { getCookies } from '@utils/lib/cookies';
import { Navigate } from 'react-router-dom';

const PrivateRouter = () => {
const isLoggedIn = !!getCookies('accessToken');
const accessToken = getCookies('accessToken');
const refreshToken = getCookies('refreshToken');
const userName = getCookies('userName');
const userEmail = getCookies('userEmail');

const isLoggedIn =
!!accessToken && !!refreshToken && !!userName && !!userEmail;

if (!isLoggedIn) {
// HACK : alert창은 추후 변경 예정입니다.
Expand Down

0 comments on commit 07767a5

Please sign in to comment.