Skip to content

20260213 fe #219 about signup page#227

Merged
discipline24 merged 8 commits intomainfrom
20260213-FE-#219-About-Signup-Page
Feb 13, 2026
Merged

20260213 fe #219 about signup page#227
discipline24 merged 8 commits intomainfrom
20260213-FE-#219-About-Signup-Page

Conversation

@yyunee
Copy link
Contributor

@yyunee yyunee commented Feb 13, 2026

1) #219

2) 변경 요약 (What & Why)

회원가입페이지

  • 이메일 --> 학번으로 변경
  • 개인정보 입력칸 추가 ( 이름, 성별, 단과대, 학과, 기수, 팀, 특이사항)

서버주소 env파일로 숨기

3) 스크린샷/동영상 (UI 변경 시)

image

4) 상세 변경사항 (전부 다)

라우팅:

  • 로그인/로그아웃 관련 라우터 접근 오류 재수정

회원가입페이지:

  • 학번입력칸추가
  • 성별 라디오 버튼추가
    *단과대학입력칸추가
    *학과입력칸추가
    *기수입력칸추가
    *팀 입력칸추가
    *특이사항입력칸 추가

전화번호 자동으로 하이픈추가
위 새로 추가한 사항들의 유효성검사코드

Summary by CodeRabbit

  • 새로운 기능

    • 회원가입 폼이 학생 정보(학번, 성별, 단과대, 학과, 기수, 팀명)를 수집하도록 확장되었습니다.
    • 페이지 로딩 중 로딩 상태 표시가 추가되었습니다.
  • 개선 사항

    • 전화번호 입력이 자동 포맷됩니다 (010-1234-5678).
    • 폼 레이아웃과 유효성 검사가 개선되었습니다.
  • 스타일

    • 반응형 디자인이 조정되었습니다.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Walkthrough

회원가입 폼에 수집 필드를 대폭 확장하고(학생 정보, 학번, 성별 등), 인증 상태 초기화/갱신 처리와 보호 라우트 로딩 표시를 조정했으며, Vite 설정을 환경변수 기반으로 전환하고 CSS 일부 레이아웃/스타일을 수정했습니다.

Changes

Cohort / File(s) Summary
회원가입 UI 및 스타일
frontend/src/components/LoginAndSignUpForm.module.css, frontend/src/components/signup/SignUpForm.jsx
폼 레이아웃을 flex-start로 조정하고 라디오 그룹·가입 버튼 스타일 추가. SignUpForm에 studentName, studentId, gender, college, department, generation, teamName, remark 등 필드와 전화번호 포맷팅/검증 로직을 추가하고 기존 nickname 제거.
인증 유틸 및 컨텍스트
frontend/src/utils/auth.js, frontend/src/contexts/AuthContext.jsx, frontend/src/utils/axios.js
signUp 시그니처와 페이로드를 확장해 새 사용자 필드를 전송하도록 변경. AuthContext 초기 loading=true 설정 및 로그인/로그아웃 시 isLoggedIn 명시적 업데이트 추가. 토큰 리프레시 실패 시 클라이언트 리다이렉션/로컬스토리지 조작 제거(에러 반환만).
라우팅 및 전역 스타일
frontend/src/components/protectedRoute.jsx, frontend/src/index.css
ProtectedRoute의 로딩 분기에서 null 대신 "로딩 중..." 텍스트를 가진 div 반환. 전역 html, body에 백그라운드 흰색 추가, 모바일에서만 body.no-scroll 규칙 적용하도록 이동.
빌드/환경 설정
frontend/vite.config.js
정적 설정에서 모드 기반 함수형 설정으로 변경; loadEnv로 환경변수를 로드하여 /api 프록시 타깃을 VITE_API_URL에서 읽도록 수정.

Sequence Diagram(s)

sequenceDiagram
    participant User as "사용자 (브라우저)"
    participant UI as "SignUpForm 컴포넌트"
    participant API as "Auth API (/api/auth/signup)"
    participant AuthU as "frontend/src/utils/auth.js"
    rect rgba(135,206,235,0.5)
    User->>UI: 회원정보 입력 및 제출
    UI->>AuthU: signUp(payload with studentName, studentId, ...)
    AuthU->>API: POST /api/auth/signup (확장된 페이로드)
    API-->>AuthU: 201 Created / 에러
    AuthU-->>UI: 성공 / 실패 응답 전달
    end
Loading
sequenceDiagram
    participant App as "클라이언트 앱"
    participant Axios as "axios 인터셉터"
    participant AuthCtx as "AuthContext"
    participant API as "토큰 리프레시 엔드포인트"
    rect rgba(144,238,144,0.5)
    App->>Axios: API 호출 (토큰 만료)
    Axios->>API: 토큰 리프레시 요청
    API-->>Axios: 리프레시 성공 / 실패
    alt 성공
        Axios->>AuthCtx: 토큰 갱신 저장
        Axios->>App: 원래 요청 재시도
    else 실패
        Axios-->>App: Promise.reject(refreshError) (더 이상 자동 리다이렉트 없음)
    end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • DongEun02
  • gxuoo

Poem

🐰 새 학번, 새 이름, 새 필드들 춤추네
당근 들고 달려온 나는 기쁘다네 🥕
로딩은 말해주고, 토큰은 조용히 갱신되지 않네
환경 변수 따라 길을 바꾸며
가입은 풍성해졌네, 폼이 웃는다!

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Invalid branch name format
Title check ❓ Inconclusive 제목이 가입 페이지 업데이트라는 주요 변경 사항을 부분적으로 반영하지만, 구체적인 내용(학번 추가, 필드 확장 등)을 명확히 드러내지 않으며 날짜 포함으로 가독성이 떨어집니다. 제목을 '회원가입 페이지 개선: 학생 정보 필드 추가 및 유효성 검사 강화' 같이 더 구체적이고 명확하게 수정하여 변경 사항을 명확히 전달하도록 권장합니다.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 20260213-FE-#219-About-Signup-Page
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch 20260213-FE-#219-About-Signup-Page
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/contexts/AuthContext.jsx (1)

34-45: ⚠️ Potential issue | 🔴 Critical

logout 성공 시 isLoggedInfalse로 설정되지 않는 버그가 있습니다.

setIsLoggedIn(false)catch 블록(Line 40)에만 있어서, 로그아웃 API 호출이 성공했을 때 isLoggedIntrue로 유지됩니다. 사용자가 로그아웃해도 인증 상태가 변경되지 않는 심각한 문제입니다.

setIsLoggedIn(false)finally 블록으로 이동하면 성공/실패 모두에서 올바르게 처리됩니다.

제안하는 수정 사항
   const logout = async () => {
     try {
       await api.post('/api/auth/logout');
     } catch (error) {
       // 로그아웃 API 실패해도 무시 (토큰이 없을 수 있음)
       console.log('로그아웃 API 호출 실패:', error.message);
-      setIsLoggedIn(false);
     } finally {
+      setIsLoggedIn(false);
       // localStorage 유저 정보 삭제
       localStorage.removeItem('user');
     }
   };
🤖 Fix all issues with AI agents
In `@frontend/src/components/LoginAndSignUpForm.module.css`:
- Around line 184-195: The .radioGroup label block has duplicated properties
(color and font-weight) and missing a generic font family; clean this by
removing the duplicate declarations so each property appears once (keep the
intended values, e.g., color: `#000` and font-weight: 400), add a fallback generic
family to font-family (e.g., "Pretendard, sans-serif"), and merge the nearly
identical rules for .inputGroup label and .radioGroup label into a single
combined selector (.inputGroup label, .radioGroup label) to avoid repetition;
also inspect and fix the same duplicate property issues inside the existing
.inputGroup label rule so the merged selector is consistent.

In `@frontend/src/components/signup/SignUpForm.jsx`:
- Around line 105-119: The phone formatter in handlePhoneChange currently always
uses a 4-digit middle group which breaks 10-digit numbers; update
handlePhoneChange to branch on total digit count: when the cleaned digits length
=== 10 format as `${slice(0,3)}-${slice(3,6)}-${slice(6,10)}` (3-3-4), when
length >= 11 format as `${slice(0,3)}-${slice(3,7)}-${slice(7,11)}` (3-4-4), and
otherwise keep the existing short-number handling; adjust the conditional order
and slice indices accordingly and continue to call
setPhoneNumber(formattedValue).
- Around line 94-103: The isFormValid expression is incorrect: replace the
undefined isPasswordValid with a derived boolean from the passwordValid state
(e.g., ensure all entries in the passwordValid array are true) and change the
function references isStudentIdValid, isPhoneNumberValid, and isGenerationValid
to be invoked (isStudentIdValid(), isPhoneNumberValid(), isGenerationValid()) so
actual validation runs; update the isFormValid assignment (the constant that
currently uses areRequiredFieldsFilled, isStudentIdValid, isEmailValid(),
isVerificationSent, isVerificationChecked, isPhoneNumberValid,
isGenerationValid, isPasswordValid, password === confirmPassword) to use the
called functions and the derived password-valid boolean (for example using
passwordValid.every(Boolean) or equivalent).

In `@frontend/src/utils/auth.js`:
- Around line 21-33: The payload construction applies trim() inconsistently:
ensure all user-entered text fields are trimmed by updating the payload object
used to build the request (the payload constant) so that studentId, college,
department, and remark also call .trim() like studentName, email, phoneNumber,
generation, and teamName do; leave password and gender as-is. Locate the payload
declaration and wrap the values for studentId, college, department, and remark
with .trim() to normalize whitespace before sending.

In `@frontend/vite.config.js`:
- Around line 5-50: The VITE_API_URL loaded by loadEnv can be undefined which
breaks the proxy target; update the defineConfig callback to validate
env.VITE_API_URL and use a safe fallback or fail-fast: compute a local symbol
(e.g., apiUrl) from env.VITE_API_URL and if missing either set a sensible
default like 'http://localhost:3000' or throw a clear error, then assign that
apiUrl to the server.proxy['/api'].target; ensure references are to
defineConfig, loadEnv, env.VITE_API_URL and server.proxy['/api'].target so the
change is easy to locate.
🧹 Nitpick comments (4)
frontend/src/components/LoginAndSignUpForm.module.css (1)

212-229: .signUpButton 스타일이 .loginButton과 거의 동일합니다.

81-98행의 .loginButton과 비교했을 때, margin 값만 다르고 나머지 속성은 동일합니다. 공통 기본 버튼 클래스를 만들고 차이점만 오버라이드하면 유지보수가 쉬워집니다.

frontend/src/utils/auth.js (1)

3-3: DEFAULT_ROLE이 더 이상 사용되지 않습니다.

이전에 signUp 페이로드에 role: DEFAULT_ROLE로 사용되었지만, 현재 페이로드에서 제거되었습니다. 사용하지 않는 상수이므로 삭제하세요.

제안하는 수정 사항
-const DEFAULT_ROLE = 'TEAM_MEMBER';
-
frontend/src/components/signup/SignUpForm.jsx (2)

316-338: 성별 라디오 버튼의 접근성을 개선할 수 있습니다.

현재 <label>성별</label>이 라디오 그룹과 프로그래밍적으로 연결되어 있지 않습니다. role="radiogroup"aria-labelledby를 사용하면 스크린 리더 사용자 경험이 향상됩니다.

제안하는 수정 사항
 <div className={styles.radioGroup}>
-  <label>성별</label>
-  <div className={styles.radioOptions}>
+  <label id="gender-label">성별</label>
+  <div className={styles.radioOptions} role="radiogroup" aria-labelledby="gender-label">

162-192: handleSignUp에서 에러 처리가 일반적이어서 사용자에게 유용한 피드백을 줄 수 없습니다.

API 응답의 에러 메시지(예: 중복 학번, 이미 가입된 이메일 등)를 파싱하여 구체적인 오류 내용을 toast.error에 표시하면 사용자 경험이 향상됩니다.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/components/signup/SignUpForm.jsx (1)

118-136: ⚠️ Potential issue | 🟡 Minor

handleSendVerificationNumberhandleCheckVerificationNumber가 동일한 abortRef를 공유합니다.

재전송 버튼 클릭 중 인증번호 확인 버튼을 누르면, 진행 중인 전송 요청이 중단됩니다(그 반대도 마찬가지). isSending 상태가 전송 버튼만 비활성화하고 확인 버튼은 비활성화하지 않으므로, 재전송과 확인이 동시에 트리거될 수 있습니다.

독립적인 AbortController를 사용하거나, 전송 중에는 확인 버튼도 비활성화하는 것을 고려해주세요.

🧹 Nitpick comments (4)
frontend/src/components/LoginAndSignUpForm.module.css (1)

207-224: .signUpButton.loginButton(79-96행)과 거의 동일합니다.

margin 속성만 다르고 나머지 속성은 동일합니다. 공통 스타일을 하나의 base 클래스로 추출하면 중복을 줄일 수 있습니다.

frontend/src/components/signup/SignUpForm.jsx (3)

211-220: 학번 입력에 maxLength 제한 추가를 권장합니다.

isStudentIdValid는 정확히 8자리 숫자를 요구하지만, 입력 필드에는 길이 제한이 없습니다. inputMode="numeric"과 함께 maxLength={8}을 추가하면 UX가 개선됩니다.

제안하는 수정 사항
             <input
               type="text"
               id="studentId"
               value={studentId}
               onChange={(e) => setStudentId(e.target.value)}
               placeholder="학번을 입력해주세요"
+              maxLength={8}
+              inputMode="numeric"
             />

308-331: 성별 라디오 버튼의 접근성(a11y)을 개선할 수 있습니다.

현재 "성별" 레이블이 <label> 태그이지만 라디오 그룹과 프로그래밍적으로 연결되어 있지 않습니다. <fieldset><legend>를 사용하면 스크린 리더 호환성이 향상됩니다.

제안하는 수정 사항
-          <div className={styles.radioGroup}>
-            <label>성별</label>
-            <div className={styles.radioOptions}>
+          <fieldset className={styles.radioGroup}>
+            <legend>성별</legend>
+            <div className={styles.radioOptions}>
               ...
-            </div>
-          </div>
+            </div>
+          </fieldset>

130-132: 에러 핸들링에서 console.log 대신 console.error를 사용하세요.

오류 객체를 console.log로 출력하고 있어, 브라우저 DevTools에서 오류 필터링 시 놓칠 수 있습니다.

제안하는 수정 사항
     } catch (error) {
-      console.log(error);
+      console.error(error);
       toast.error('오류가 발생했습니다.');

Also applies to: 149-151, 180-182

Copy link
Contributor

@discipline24 discipline24 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

@discipline24 discipline24 merged commit 0ede169 into main Feb 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants