-
Notifications
You must be signed in to change notification settings - Fork 0
#31/feat/add login and register #32
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
base: main
Are you sure you want to change the base?
Conversation
designDefined
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.
이상한 에러가 나길래 이것저것 엄청 뜯어봤는데... next 자체 에러였습니다ㅠㅜ
아래 달아둔 코멘트 외에, 작업하실 때
next.config.js 파일의 output: 'export' 속성이 있는 행을 주석처리해주세요(nextConfig 오브젝트 안에 아무 것도 없게) 그러면 회원가입 관련 리스폰스가 제대로 올 겁니다
추가적으로 코멘트로 개선점들 좀 달아두었습니다! 좀 간단히 적어두어서, 애매한 부분은 회의 때 같이 봅시다
| import Link from "next/link"; | ||
|
|
||
| export default function SubmitButton() { | ||
| export default function SubmitButton({ status }) { |
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.
여기 onClick prop이 버튼 태그로 전달이 되지 않는 것 같습니다!
| headers: { | ||
| "Content-Type": "application/json", | ||
| }, |
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.
json으로 보내면 굳이 요 헤더는 없어도 자동으로 헤더 달아서 보내줄거에요 한 번 확인해보시지요
| const [PWRegisterValue, setPWRegisterValue] = useState(""); | ||
| const [PWConfirmValue, setPWConfirmValue] = useState(""); | ||
| const [nameValue, setNameValue] = useState(""); | ||
| const [registerSuccess, setRegisterSuccess] = useState(false); |
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.
굳이 이 state를 둔 이유는?
| if (registerSuccess === true) { | ||
| // 성공한 경우 다른 페이지로 이동 | ||
| router.push("/login"); |
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.
한 번 성공하면 registerSuccess가 true가 되고, 다시 register 버튼을 눌렀을 때 이 if문의 함수가 작동해서 /login으로 이동을 하는데, 성공 시 바로 /login으로 이동한다면 굳이 필요는 없는 부분인 것 같습니다. 그보다는 이미 회원가입 요청이 보내져 진행 중일 때 handleButtonAction이 두 번 작동되게 하는 If문이 좀 더 어울리지 않을까 하네요
| // 아직 작업을 실행하지 않은 경우 | ||
| try { | ||
| await handleRegister(); // 회원가입 요청 완료를 기다림 | ||
| setRegisterSuccess(true); |
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.
handleRegister에도 setRegisterSuccess(true) 함수가 있는데, 여기에도 있을 필요는 없을 것 같습니다. 그리고 handleRegister 자체는 성공/실패를 리턴하지 않아서 그 아래에 있는 setRegisterSuccess가 항상 작동하는 것 같아요! 실제로 에러가 발생했을 때에도 성공했다는 메시지가 표시됩니다
@designDefined 현재 양식에 맞게 정보를 입력하고 '가입' 버튼 클릭 시, internal server error 발생합니다. 이거 혹시 봐주실 수 있을까요? 지금까지 한 작업 커밋해 두겠습니다! |
|
아직 handleRegister에 리턴 값을 넣는 작업은 시작 안 했는데, 현재는 handleButtonAction 자체를 지워버렸기 때문에 위의 에러는 이와 상관없겠죠?? |
|
@designDefined 나머지 todo는 일단 완료했습니다! contextAPI 는 다음 PR에서 해보겠습니다! |
designDefined
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.
작동 잘 되는 거 확인했습니다~ 고생했으

요약
관련 이슈
#31
체크리스트
PR 달 때
yarn build로 테스트를 했나요?머지하기 전에
작업 내용
논의가 필요한 사항