Skip to content

Conversation

@joodongkim
Copy link
Collaborator

요구사항

기본

  • 유효한 정보를 입력하고 스웨거 명세된 “/auth/signUp”으로 POST 요청해서 성공 응답을 받으면 회원가입이 완료됩니다.
  • 회원가입이 완료되면 “/login”로 이동합니다.
  • 회원가입 페이지에 접근시 로컬 스토리지에 accessToken이 있는 경우 ‘/’ 페이지로 이동합니다
  • 회원가입을 성공한 정보를 입력하고 스웨거 명세된 “/auth/signup”으로 POST 요청을 하면 로그인이 완료됩니다.
  • 로그인이 완료되면 로컬 스토리지에 accessToken을 저장하고 “/” 로 이동합니다.
  • 로그인/회원가입 페이지에 접근시 로컬 스토리지에 accessToken이 있는 경우 ‘/’ 페이지로 이동합니다.
  • 로컬 스토리지에 accessToken이 있는 경우 상단바 ‘로그인’ 버튼이 판다 이미지로 바뀝니다.

심화

주요 변경사항

스크린샷

image

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

withyj-codeit and others added 30 commits September 3, 2023 21:57
* First commit Sprint Mission5 on React

* Sprint mission 6 commit.

* Sprint Mission 6 Update 1

* update sprint mission 6

* Sprint mission 6 update commit.

* delete .bak files

* Update Comments

* modify ItemComment
@joodongkim joodongkim added the 순한맛🐑 마음이 많이 여립니다.. label Nov 9, 2024
@GANGYIKIM GANGYIKIM self-requested a review November 11, 2024 00:12
@GANGYIKIM GANGYIKIM changed the title Next 김주동 sprint11 [김주동] sprint11 Nov 11, 2024
Copy link
Collaborator

@GANGYIKIM GANGYIKIM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주동님 이번 스프린트 미션 고생하셨습니다~
불필요한 주석이 많아서 다음에는 정리후 PR 올려주시면 더 좋을 것 같아요!

시간이 되시면 리팩토링을 통해 코드정리를 해보시면 더 좋을 것 같습니다~

Comment on lines +8 to +10
headers: {
"Content-Type": "application/json",
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3:
header content-type 에 대한 mdn 문서입니다~
전송되는 데이터 타입에 대해 명시해주는 값입니다.

https://developer.mozilla.org/ko/docs/Web/HTTP/Headers/Content-Type

"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.53.1",
"react-router-dom": "^6.28.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3:
next가 깔려있으니 next를 사용하시면 더 좋겠습니다~

id: string;
label: string;
placeholder: string;
register: UseFormRegisterReturn; // react-hook-form의 register 함수 사용
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2:
register이라는 명은 꼭.. react-hook-form의 register 함수 자체를 의미하는 것 같습니다.
더 적절한 이름이면 좋을 것 같아요.

register,
errorMessage,
}) => {
const [showPassword, setShowPassword] = useState(false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3:
boolean 값에서 이름은 isShowPassword가 더 일반적일 것 같습니다~

formState: { errors, isValid },
} = useForm<LoginFormValues>({ mode: "onChange" });

const onSubmit: SubmitHandler<LoginFormValues> = async (data) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2:
data 자체로 사용하지 않으니 아래처럼 분해해서 쓰시는게 더 좋을 것 같습니다.

Suggested change
const onSubmit: SubmitHandler<LoginFormValues> = async (data) => {
const onSubmit: SubmitHandler<LoginFormValues> = async ({ email, password }) => {

@GANGYIKIM GANGYIKIM merged commit 8d396a7 into codeit-bootcamp-frontend:Next-김주동 Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

순한맛🐑 마음이 많이 여립니다..

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants