Conversation
- 응답 상태 코드를 하드코딩된 숫자 대신 statusCode 상수로 대체함 - 응답 메시지를 responseMessage 상수로 대체 - console.log()와 var 사용 제거
- 사용자가 서버에 업로드하는 이미지 파일을 Git 추적에서 제외함
- 기존의 가입 페이지 코드 삭제 - 의사 계정 가입 기능을 개발하기 전(환자 계정만 있었을 때), 사용하던 코드였음 - 의사 기능 만들면서 join 을 patientJoin, doctorJoin 으로 재구현함
- 응답 상태 코드 및 메시지를 statusCode 및 responseMessage 상수로 대체함 - 디버깅용 console.log()를 제거하고 require 모듈 순서를 정리하여 코드 클린업을 진행함 - 매직넘버로 되어있던 salt 값을 상수로 변경
- 응답 상태 코드 및 응답 메시지를 statusCode, responseMessage 상수로 대체함 - 불필요한 console.log()를 제거, require 모듈 순서 정리
Summary of ChangesHello @vvzvvv, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 사용자 인증 및 등록 흐름을 리팩토링하여 응답 메시지와 상태 코드를 전용 상수 파일로 중앙 집중화합니다. 또한, 이메일 확인, 회원가입, 로그인과 같은 사용자 상호작용 시 메시지 표시를 위해 기본 브라우저 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
| } catch (err) { | ||
| console.error('Error:', err); | ||
| alert(`${error.message}`); | ||
| showToast(`${error.message}`); |
| ALREADY_EMAIL: '이미 사용중인 이메일입니다.', | ||
| NON_AVAILABLE_EMAIL: '이미 사용중인 이메일입니다.', | ||
| AVAILABLE_EMAIL: '사용 가능한 이메일입니다.', | ||
| DIFFRERENT_PASSWORD: '비밀번호와 비밀번호 확인이 일치하지 않습니다', |
| return res.status(200).send({ message: "회원가입 되었습니다.\n로그인 해주세요."}); | ||
|
|
||
| return res.status(statusCode.OK).send({ message: responseMessage.CREATED_USER }); |
There was a problem hiding this comment.
새로운 환자 리소스가 생성되었으므로, HTTP 상태 코드로 200 OK 대신 201 Created를 반환하는 것이 RESTful API 설계 원칙에 더 부합합니다. joinDoctorPOST.js에서도 201 Created를 사용하고 있으므로 일관성을 위해 수정하는 것을 권장합니다.
| return res.status(statusCode.OK).send({ message: responseMessage.CREATED_USER }); | |
| return res.status(statusCode.CREATED).send({ message: responseMessage.CREATED_USER }); |
| // 비밀번호 더블체크 로직 | ||
| if (newPassword !== doubleCheckNewPassword) { | ||
| return res.status(400).send('비밀번호 불일치'); | ||
| return res.status(statusCode.BAD_REQUEST).send(responseMessage.DIFFRERENT_PASSWORD); |
There was a problem hiding this comment.
| }); | ||
| } catch (error) { | ||
| res.status(500).send({ message: "비밀번호 변경이 실패하였습니다.\n나중에 다시 시도해주세요."}); | ||
| res.status(500).send({ message: responseMessage.FAIL_UPDATE_PASSWORD }); |
There was a problem hiding this comment.
📝 PR 요약
회원가입/로그인/비밀번호 변경/찾기 로직에 statusCode 및 responseMessage 상수를 적용하였습니다.
로그인 및 회원가입 페이지의 오류 알림 방식을 alert에서 토스트 메시지로 전환하여 UX를 개선했습니다.
불필요한 파일과 디버깅 코드를 제거하고 모듈 순서를 정리하는 등 전반적인 코드 클린업을 수행했습니다.
resolved: [FEATURE] 회원가입/로그인 페이지 - 기존 alert 삭제 및 토스트 메시지 도입 #5
📌 변경 사항 및 주의 사항
기능 및 UX 개선 (feat)
showToast) 및 관련 CSS를 추가하고, 로그인 페이지의 오류 알림 방식을alert에서 토스트 메시지로 변경했습니다.statusCode및responseMessage상수를 추가하고, 회원가입 및 프로필 관련 메시지를 추가로 작성했습니다..gitignore에 사용자가 업로드한 이미지 경로를 추가하여, 업로드한 파일이 커밋되지 않게 했습니다.구조 및 로직 개선 (refactor & cleanup)
console.log()및var사용을 제거하고,require모듈의 순서를 표준 컨벤션에 맞게 정리했습니다.불필요 파일 제거
join.ejs파일을 삭제하고, 의사 가입 시 사용되던 인증서 이미지 파일을 삭제했습니다.