-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: 어드민페이지 로그인 기능 구현 #293
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
Feat: 어드민페이지 로그인 기능 구현 #293
Conversation
|
@ParkSohyunee is attempting to deploy a commit to the Eujin Ahn's projects Team on Vercel. A member of the Team first needs to authorize it. |
seoyoung-min
left a comment
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.
소현님 확인이 늦었습니다! 어드민이 어려운 과제였을텐데, 기능들부터 이렇게 로그인까지 구현해 주셔서 너무 감사합니다 :) 이제는 AT, RT 너무 잘 아시는 소현님 ˃̵͈̑ᴗ˂̵͈̑ 👍👍
| const onSubmit = async (values: FormValuesType) => { | ||
| try { | ||
| const { data } = await axiosInstance.post('/admin/login', values); | ||
|
|
||
| const adminAccessToken = data.accessToken; | ||
| const adminRefreshToken = data.refreshToken; | ||
|
|
||
| setCookie('admin-accessToken', adminAccessToken, 'AT'); | ||
| setCookie('admin-refreshToken', adminRefreshToken, 'ADMIN'); | ||
|
|
||
| router.push('/admin/topics'); | ||
| } catch (error) { | ||
| console.log(error); | ||
| } | ||
| }; |
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.
이제는 로그인의 달인이 되신 소현님...!!
| <form onSubmit={handleSubmit(onSubmit)} className={styles.form}> | ||
| <div className={styles.field}> | ||
| <label htmlFor="account" className={styles.label}> | ||
| 🐳 아이디 |
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.
🐳🤍
|
|
||
| if (error.response?.status === 401 && error.response?.data.error === 'UNAUTHORIZED') { | ||
| if (!isRefreshing && refreshToken === undefined) { | ||
| // accessToken 만료되었는데, refreshToken 없는 경우, storage 비우기 |
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.
주석들 덕분에 이해하기 편했습니다! 👍
개요
작업 사항
참고 사항 (optional)
리뷰어에게