Merged
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
approved these changes
Jan 25, 2025
Contributor
seoyoung-min
left a comment
There was a problem hiding this comment.
소현님 확인이 늦었습니다! 어드민이 어려운 과제였을텐데, 기능들부터 이렇게 로그인까지 구현해 주셔서 너무 감사합니다 :) 이제는 AT, RT 너무 잘 아시는 소현님 ˃̵͈̑ᴗ˂̵͈̑ 👍👍
Comment on lines
+25
to
+39
| 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); | ||
| } | ||
| }; |
Contributor
There was a problem hiding this comment.
이제는 로그인의 달인이 되신 소현님...!!
| <form onSubmit={handleSubmit(onSubmit)} className={styles.form}> | ||
| <div className={styles.field}> | ||
| <label htmlFor="account" className={styles.label}> | ||
| 🐳 아이디 |
|
|
||
| if (error.response?.status === 401 && error.response?.data.error === 'UNAUTHORIZED') { | ||
| if (!isRefreshing && refreshToken === undefined) { | ||
| // accessToken 만료되었는데, refreshToken 없는 경우, storage 비우기 |
Contributor
There was a problem hiding this comment.
주석들 덕분에 이해하기 편했습니다! 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
작업 사항
참고 사항 (optional)
리뷰어에게