Skip to content

feat(be): modify signup logic#3598

Open
juheon429 wants to merge 5 commits into
feat/remove-whitelistfrom
t2730-modify-signup-logic
Open

feat(be): modify signup logic#3598
juheon429 wants to merge 5 commits into
feat/remove-whitelistfrom
t2730-modify-signup-logic

Conversation

@juheon429
Copy link
Copy Markdown
Contributor

@juheon429 juheon429 commented May 28, 2026

Description

Additional context

화이트리스트 제거에 따른 회원가입 로직 수정

  1. SignUpDtonickname, jobType 필드 추가
  2. UpdateUserDtonickname 필드 추가
  3. 이메일 인증 시 @skku.edu 도메인 제한 제거
  4. jobType에 따른 회원가입 분기 처리
    • 성균관대학교 재학생: 학번, 학과 필수 입력 + @skku.edu 이메일 검증
    • 일반 대학생: 대학교 이름 필수 입력
    • 고등학생/직장인/기타: 추가 정보 없이 회원가입 진행
  5. createUsernickname, jobType 저장 추가
  6. getUserProfilenickname, jobType, profileImageUrl 응답 추가
  7. UpdateUserDtonickname 필드 추가
  8. updateUsernickname 수정 기능 추가

Before submitting the PR, please make sure you do the following

Copy link
Copy Markdown
Contributor

@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

This pull request updates the user sign-up process by adding nickname and jobType fields to the SignUpDto and implementing validation logic based on the user's job type. Specifically, it removes the @skku.edu email restriction during the initial pin generation and instead enforces it during registration for users who identify as Sungkyunkwan University (SKKU) students, alongside requiring their student ID and major. Other college students are required to provide their college name. Feedback on these changes highlights potential issues with the validation logic: the check for SKKU affiliation can be easily bypassed with variations like '성균관대' or 'SKKU', and the email domain check is case-sensitive and should convert the email to lowercase first to prevent false negatives.

Comment on lines +389 to +392
if (
signUpDto.jobType === JobType.CollegeStudent &&
signUpDto.college?.includes('성균관대학교')
) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

성균관대학교 학생인 경우 학번, 학과 및 @skku.edu 이메일 인증을 강제하고 있으나, signUpDto.college?.includes('성균관대학교') 조건은 '성균관대' 또는 'SKKU'와 같은 입력에 대해 우회될 수 있습니다. 대학 이름 입력값을 정규화하거나 대표적인 약칭들을 함께 검사하는 로직을 추가하는 것이 안전합니다.

    if (
      signUpDto.jobType === JobType.CollegeStudent &&
      signUpDto.college &&
      /|skku/i.test(signUpDto.college)
    ) {

Comment on lines +396 to +398
if (!email.endsWith('@skku.edu')) {
throw new UnprocessableDataException('SKKU not using @skku.edu email')
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

email.endsWith('@skku.edu') 검사는 대소문자를 구분합니다. 사용자가 이메일 주소에 대문자를 포함하여 인증받은 경우(예: user@SKKU.EDU), 이 조건문에서 검증이 실패할 수 있습니다. 안전하게 비교하기 위해 이메일을 소문자로 변환한 후 검사하는 것이 좋습니다.

Suggested change
if (!email.endsWith('@skku.edu')) {
throw new UnprocessableDataException('SKKU not using @skku.edu email')
}
if (!email.toLowerCase().endsWith('@skku.edu')) {
throw new UnprocessableDataException('SKKU not using @skku.edu email')
}

@juheon429 juheon429 self-assigned this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant