-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix]: 서버 로그인 로직 변경에 따른 AccessToken, RefeshToken 쿠키 세팅 제거 및 landingStatus 제거 #87
Changes from all commits
ec6dfe3
99c1695
e7f5c18
aa0d4ab
6beb924
5265c04
171e886
45766be
cebc9b2
3d3bb87
d6c5642
ad6d611
dee2194
17a8c6d
3fa3455
f99e7ca
ad7522f
2e70d63
ca39fb5
f93c7e9
aada2ed
628fb39
1074b1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
import useLandingStatus from '@/hooks/zustand/useLandingStatus'; | ||
import { useEffect } from 'react'; | ||
import { Outlet } from 'react-router-dom'; | ||
import RoutePath from '@/routes/routePath'; | ||
import { isAuthenticated } from '@/utils/auth'; | ||
import { toast } from 'react-toastify'; | ||
import { useNavigate, Outlet } from 'react-router-dom'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
export default function AuthAccessGuard() { | ||
const { clearLandingStatus } = useLandingStatus(); | ||
const navigate = useNavigate(); | ||
const [redirect, setRedirect] = useState(false); | ||
|
||
useEffect(() => { | ||
clearLandingStatus(); | ||
if (!isAuthenticated()) { | ||
toast.error('로그인이 필요한 서비스예요.'); | ||
setRedirect(true); | ||
} | ||
}, []); | ||
|
||
return <Outlet />; | ||
useEffect(() => { | ||
if (redirect) { | ||
navigate(RoutePath.Home); | ||
} | ||
}, [redirect, navigate]); | ||
|
||
return isAuthenticated() ? <Outlet /> : null; | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대시보드에서 Box uI를 통해서 현재 모집이 마감되었는지 아닌지를 판단하기 때문에, 가입하기로 통일하기로 했습니다