Skip to content

[Feat/117] 일반 이메일 로그인/회원가입 폼 구현 및 계정 연동 플로우 추가 - #118

Merged
hamlsy merged 2 commits into
mainfrom
feat/117
Mar 31, 2026
Merged

[Feat/117] 일반 이메일 로그인/회원가입 폼 구현 및 계정 연동 플로우 추가#118
hamlsy merged 2 commits into
mainfrom
feat/117

Conversation

@hamlsy

@hamlsy hamlsy commented Mar 31, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Email-based signup and login with form validation
    • Dedicated signup page with per-field error messages and inline validation
    • Login redirect support via query parameter
    • Authentication-specific error handling with toast notifications for account type issues

hamlsy and others added 2 commits March 30, 2026 14:24
- EmailSignupView.vue 신규 생성: 이메일/비밀번호/닉네임 폼, 실시간 유효성 검사, 비밀번호 강도 바, API 에러 인라인 표시, 가입 즉시 자동 로그인
- LoginView.vue 개편: 이메일 로그인 폼, 구분선, 소셜 전용 계정 토스트 알림(4105), 가입 링크 추가
- useAuth.js: login() 응답 구조 버그 수정(response.data.data), JWT decode로 memberId 추출, signup() 추가
- validators.js: email/password/nickname/passwordMatch 유효성 함수 구현
- errorCodes.js: AUTH_ERROR_CODES 네임스페이스 추가(4101~4105)
- endPoint.js: REGISTER → SIGNUP('/auth/signup') 교체
- auth.service.js: register() → signup() 교체
- router/index.js: afterEach 조건에 /signup 추가(WebSocket 연결 트리거)
- mainRoutes.js: /signup 라우트 등록

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hamlsy
hamlsy merged commit 366ba15 into main Mar 31, 2026
1 of 2 checks passed
@hamlsy
hamlsy deleted the feat/117 branch March 31, 2026 13:29
@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 52c52c43-42ae-4236-988f-d90c7a4bd308

📥 Commits

Reviewing files that changed from the base of the PR and between bd10d4d and 8a67196.

📒 Files selected for processing (11)
  • KoSpot-frontend-private
  • docs/plans/feat-117-email-auth.md
  • src/core/api/endPoint.js
  • src/core/composables/useAuth.js
  • src/core/constants/errorCodes.js
  • src/core/utils/validators.js
  • src/features/auth/services/auth.service.js
  • src/features/auth/views/EmailSignupView.vue
  • src/features/auth/views/LoginView.vue
  • src/router/index.js
  • src/router/mainRoutes.js

📝 Walkthrough

Walkthrough

This PR implements email-based authentication by updating API endpoints, introducing signup/login flows, adding form validation utilities, creating signup and enhanced login views, managing JWT tokens with member ID extraction, and configuring routes to support the new signup path.

Changes

Cohort / File(s) Summary
Submodule Update
KoSpot-frontend-private
Updated Git submodule reference to point to new commit hash.
API Endpoints & Constants
src/core/api/endPoint.js, src/core/constants/errorCodes.js
Replaced AUTH.REGISTER with AUTH.SIGNUP endpoint; added AUTH_ERROR_CODES mapping for auth-specific error codes (4101–4105).
Validation Utilities
src/core/utils/validators.js
Introduced validators object with email regex, password length (min 8), nickname length (2–12), and password match validation functions.
Auth Composable
src/core/composables/useAuth.js
Enhanced login() to parse nested response structure and extract memberId from JWT payload; added signup() method replacing register; both handle token persistence, push registration, and return standardized result objects; added internal decodeJwtPayload() helper.
Auth Service
src/features/auth/services/auth.service.js
Renamed register() to signup() with endpoint changed from /auth/register to /auth/signup; clarified parameter type to { email, password, nickname }.
Auth Views
src/features/auth/views/EmailSignupView.vue, src/features/auth/views/LoginView.vue
Added full EmailSignupView component with email/password form, per-field validation, inline error display for duplicate email/nickname, and submit/loading states; enhanced LoginView with email login form, redirect handling via query param, social-only account detection (code 4105), and signup navigation link.
Router Configuration
src/router/mainRoutes.js, src/router/index.js
Registered /signup route pointing to EmailSignupView; updated afterEach guard to treat /signup as "coming from login" for WebSocket reconnection logic.
Documentation
docs/plans/feat-117-email-auth.md
Added comprehensive feature specification outlining endpoint changes, composable API modifications, validation rules, error handling, UI components, and routing updates.

Sequence Diagram(s)

sequenceDiagram
    participant User as User (Email Signup)
    participant EmailSignupView as EmailSignupView
    participant useAuth as useAuth Composable
    participant AuthAPI as Auth API<br>/auth/signup
    participant PushService as Push Service
    participant Router as Router

    User->>EmailSignupView: Submit email, password
    EmailSignupView->>EmailSignupView: Validate fields
    EmailSignupView->>useAuth: signup({ email, password })
    useAuth->>AuthAPI: POST /auth/signup
    AuthAPI-->>useAuth: { accessToken, refreshToken, memberId }
    useAuth->>useAuth: Decode JWT, extract memberId
    useAuth->>useAuth: Store tokens & memberId in state
    useAuth->>useAuth: Restart tokenRefreshService
    useAuth->>PushService: Register push tokens
    PushService-->>useAuth: Response (errors ignored)
    useAuth-->>EmailSignupView: { success: true }
    EmailSignupView->>Router: Navigate to /main
    Router-->>User: Redirect complete
Loading
sequenceDiagram
    participant User as User (Email Login)
    participant LoginView as LoginView
    participant useAuth as useAuth Composable
    participant AuthAPI as Auth API<br>/auth/login
    participant PushService as Push Service
    participant Router as Router

    User->>LoginView: Submit email, password
    LoginView->>useAuth: login({ email, password })
    useAuth->>AuthAPI: POST /auth/login
    AuthAPI-->>useAuth: { accessToken, refreshToken, memberId? }
    useAuth->>useAuth: Decode JWT if memberId absent
    useAuth->>useAuth: Store tokens & memberId in state
    useAuth->>useAuth: Restart tokenRefreshService
    useAuth->>PushService: Register push tokens
    PushService-->>useAuth: Response (errors ignored)
    useAuth-->>LoginView: { success: true } or<br>{ success: false, code, message }
    alt Success
        LoginView->>Router: Navigate to redirect param or /main
        Router-->>User: Redirect complete
    else Failure - Social Only Account
        LoginView->>LoginView: Show toast notification
        LoginView-->>User: Display error message
    else Failure - Other
        LoginView->>LoginView: Set loginError state
        LoginView-->>User: Display inline error
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hop along the signup path so fine,
Email, password, all by design!
Tokens decoded, members identified,
Login flows where auth can't hide!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/117

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.

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.

1 participant