Skip to content

[♻️ Refactor] 로그인 회원가입 특정 알림 팝업사용으로 교체#221

Merged
eunji0124 merged 1 commit into
mainfrom
refactor/213/loginsignup
Jan 17, 2026
Merged

[♻️ Refactor] 로그인 회원가입 특정 알림 팝업사용으로 교체#221
eunji0124 merged 1 commit into
mainfrom
refactor/213/loginsignup

Conversation

@eunji0124
Copy link
Copy Markdown
Contributor

✅ PR 체크리스트

  • 기능 정상 동작
  • 콘솔 에러 없음
  • UI 동작 및 반응형 레이아웃 확인

🔗 이슈 번호

✨ 작업한 내용

♻️ Refactor: 회원가입, 로그인 에러메세지 처리 방식 정리

💁 리뷰 요청 / 코멘트

이미 사용중인 이메일, 비밀번호 일치하지 않을때 두 케이스만 모달 베이직 팝업 적용
인풋 검사는 바로 아래 빨간 글자로 표현,
이외 알림은 토스트 팝업으로 정리

image image

💡 참고사항

@eunji0124 eunji0124 added this to the 🐛 버그/테스팅 milestone Jan 17, 2026
@eunji0124 eunji0124 self-assigned this Jan 17, 2026
@eunji0124 eunji0124 added the ♻️ Refactor 코드 리팩토링 label Jan 17, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @eunji0124, 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은 로그인 및 회원가입 페이지의 에러 메시지 표시 로직을 개선합니다. 사용자 피드백을 위한 구조화된 접근 방식을 도입하여, 비밀번호 불일치나 이메일 중복과 같은 특정 에러에는 BasicModal을 사용하고, 다른 일반적인 에러에는 toast 알림을 활용합니다. 이를 통해 사용자에게 더 명확하고 일관된 정보를 제공하여 전반적인 사용자 경험을 향상시킵니다.

Highlights

  • 에러 메시지 처리 방식 리팩토링: 로그인 및 회원가입 페이지의 에러 메시지 처리 로직을 리팩토링하여 사용자에게 보다 명확하고 일관된 피드백을 제공합니다.
  • 특정 에러에 BasicModal 적용: 로그인 시 '비밀번호 불일치' 및 회원가입 시 '이메일 중복'과 같은 특정 중요 에러는 BasicModal을 통해 사용자에게 알립니다.
  • 일반 에러에 Toast 알림 적용: 로그인 시 '미등록 이메일' 또는 회원가입 시 '닉네임 중복'과 같은 다른 일반적인 에러는 toast 알림으로 표시됩니다.
  • 인풋 유효성 검사 유지: 인풋 유효성 검사 에러는 기존과 동일하게 해당 인풋 필드 아래에 빨간 글씨로 표시됩니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 로그인 및 회원가입 페이지의 오류 처리 방식을 개선하여 특정 오류에 대해 모달 팝업을 사용하도록 리팩터링했습니다. 전반적으로 코드의 사용자 경험이 개선되었지만, API 오류 메시지 문자열에 의존하여 분기하는 방식은 백엔드 메시지가 변경될 경우 애플리케이션이 오작동할 수 있는 위험이 있습니다. 보다 안정적인 구현을 위해 API에서 제공하는 오류 코드를 사용하는 것을 권장합니다. 아래에 관련하여 두 가지 의견을 남겼습니다.

Comment on lines +81 to 105
const errorMessage = getApiErrorMessage(
err,
'로그인 중 오류가 발생했습니다.'
);
// 비밀번호 불일치 케이스만 모달팝업으로 표현
if (errorMessage.includes('비밀번호가 일치하지 않습니다')) {
openModal({
component: BasicModal,
props: {
message: '비밀번호가 일치하지 않습니다',
buttonText: '확인',
onClick: () => closeModal(BasicModal),
},
});
// 에러 상태 초기화
setErrors({ email: '', password: '' });
} else if (
errorMessage.includes('존재하지 않는') ||
errorMessage.includes('찾을 수 없') ||
errorMessage.includes('not found')
) {
toast.error('등록되지 않은 이메일입니다');
} else {
toast.error('로그인에 실패했습니다. 다시 시도해 주세요.');
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

API 에러 메시지 문자열에 의존하여 로직을 분기하는 방식은 백엔드 응답이 변경될 경우 예기치 않은 동작을 유발할 수 있어 불안정합니다. 예를 들어, '비밀번호가 일치하지 않습니다'라는 메시지가 약간이라도 변경되면 현재 로직이 깨지게 됩니다.

더 안정적인 오류 처리를 위해 백엔드 API에서 명시적인 에러 코드(예: INVALID_PASSWORD, USER_NOT_FOUND)를 반환하도록 하고, 프론트엔드에서는 이 코드를 기반으로 분기하는 것을 강력히 권장합니다.

만약 백엔드 수정이 당장 어렵다면, 이 구현을 임시방편으로 사용하되 장기적으로는 에러 코드를 도입하는 방향으로 개선하는 것이 좋습니다.

References
  1. For robust error handling, use API error codes or dedicated field names for branching logic instead of relying on parsing error message strings.

Comment on lines +97 to 132
const errorMessage = getApiErrorMessage(
error,
'회원가입 중 오류가 발생했습니다.'
);

//이미 사용중인 이메일 케이스만 모달로 표시
if (
errorMessage.includes('이미 사용중인 이메일') ||
errorMessage.includes('중복된 이메일')
) {
openModal({
component: BasicModal,
props: {
message: '이미 사용중인 이메일입니다',
buttonText: '확인',
onClick: () => closeModal(BasicModal),
},
});
// 에러 상태 초기화 (모달로 표시하므로 input 에러는 제거)
setErrors({
email: '',
nickname: '',
password: '',
passwordConfirm: '',
});
} // 닉네임 중복 toast
else if (
errorMessage.includes('이미 사용중인 닉네임') ||
errorMessage.includes('중복된 닉네임')
) {
toast.error('이미 사용중인 닉네임입니다');
}
// 그 외 에러
else {
toast.error('회원가입에 실패했습니다. 다시 시도해 주세요.');
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

로그인 페이지와 마찬가지로, 회원가입 과정에서도 API 에러 메시지 문자열을 직접 파싱하여 처리하고 있습니다. '이미 사용중인 이메일'과 같은 문자열에 의존하는 것은 백엔드 메시지가 변경될 때 기능이 오작동할 위험이 있습니다.

안정성을 높이기 위해 백엔드에서 EMAIL_ALREADY_EXISTS, NICKNAME_ALREADY_EXISTS와 같은 명확한 에러 코드를 제공하고, 프론트엔드에서는 이 코드를 사용하여 오류를 처리하는 것이 좋습니다. 이는 코드의 가독성과 유지보수성을 향상시키는 데도 도움이 됩니다.

References
  1. For API error handling, prefer using explicit error codes from the backend over parsing error message strings. If the backend does not provide error codes, parsing the message is a permissible temporary workaround, but a backend update to include error codes should be prioritized.

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@sylee86 sylee86 left a comment

Choose a reason for hiding this comment

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

승인하겠습니다.

@eunji0124 eunji0124 merged commit 45c1e73 into main Jan 17, 2026
1 check passed
@eunji0124 eunji0124 deleted the refactor/213/loginsignup branch January 17, 2026 08:47
heyudin added a commit to heyudin/global-nomad that referenced this pull request Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[♻️ Refactor] 로그인 회원가입 특정 알림 팝업사용으로 교체

2 participants