Skip to content

Commit

Permalink
add auth check on login page
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Oct 28, 2023
1 parent f304146 commit f680ede
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pages/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ const LoginPage = () => {
const [email, setEmail] = useState('')
const [password, setPW] = useState('')

useEffect(() => {
PoPoAxios.get('/auth/verifyToken', {
withCredentials: true,
}).then(() => {
alert('이미 로그인 상태 입니다.')
router.push('/')
})
}, [router])

const handleLogin = async () => {
try {
await PoPoAxios.post('/auth/login/admin', {
Expand Down

0 comments on commit f680ede

Please sign in to comment.