Skip to content

Conversation

@yoorli
Copy link
Member

@yoorli yoorli commented Dec 8, 2025

📝 변경 사항

💡 types/service/auth.ts

  • SignupRequest, SignupResponse, LoginRequest, LoginResponse 타입 정의

💡 types/service/common.ts

  • 공통 에러 응답용 CommonErrorResponse 타입 정의

💡 api/service/auth-service.ts 외

  • authServiceRemote 추가 (로그인/회원가입/로그아웃 원격 API 연동)
  • isProblemDetailError 타입 가드 추가 (Axios + ProblemDetail 기반 에러 판별)

💡 mocks/auth-mock.ts,
💡 mocks/auth-utils.ts,
💡 mocks/auth-handlers.ts

  • AuthMockUserauthMockUsers 목 유저 데이터 정의
  • createLoginResponse, createSignupResponse 유틸 추가
  • 이메일/닉네임 중복 체크 유틸 (isEmailTaken, isNicknameTaken) 추가
  • 회원가입 시 이메일/닉네임 중복 에러, 로그인 시 INVALID_CREDENTIALS 에러를 반환하는 MSW 핸들러 구현
  • 로그아웃 목 핸들러 추가

💡 components/pages/signup/signup-form/index.tsx

  • authServiceRemote().signup 연동
  • ProblemDetail 기반 에러 응답 처리 및 사용자 메시지 노출
  • 성공 시 폼 리셋 및 /login 페이지로 이동
  • getHintMessageAnyFieldApi 기반으로 공통화하여 필드별 검증 메시지 처리

💡 components/pages/login/login-form/index.tsx

  • authServiceRemote().login 연동
  • ProblemDetail 기반 에러 응답 처리 및 사용자 메시지 노출
  • 성공 시 폼 리셋 및 홈(/)으로 이동
  • tanstack-form 상태(canSubmit, isSubmitting, isPristine)를 사용한 버튼 비활성화 조건 정리

🔗 관련 이슈

Closes #58


🧪 테스트 방법

  • 수동 테스트 검증(로컬 환경)
  • 유닛 테스트 검증
  • 통합 테스트 검증

📸 스크린샷 (선택)


📋 체크리스트

  • 관련 문서를 업데이트했습니다 (필요한 경우)
  • 테스트를 추가/수정했습니다 (필요한 경우)
  • Breaking change가 있다면 명시했습니다

💬 추가 코멘트

  • 현재 Auth API는 MSW 기반 목킹으로 동작하며, 에러 코드(A001, A002, A003)와 에러 메시지는 백엔드 스펙 확정 후 맞춰서 조정할 예정입니다.
  • 실제 백엔드 연동 시 CommonErrorResponse 구조와 에러 코드 매핑이 변경될 수 있습니다.

CodeRabbit Review는 자동으로 실행되지 않습니다.

Review를 실행하려면 comment에 아래와 같이 작성해주세요

@coderabbitai review

@github-actions github-actions bot requested a review from Chiman2937 December 8, 2025 07:53
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

📊 Coverage Report

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-08 08:45:53

📉 #111main에 병합하면 coverage가 2.69% 감소합니다.

Coverage 요약

@@             Coverage Diff             @@
##             main     #111       +/-   ##
===========================================
- Coverage   35.59%   32.90%    -2.69%     
===========================================
  Files          91       97        +6     
  Lines        3492     3777      +285     
  Branches      174      180        +6     
===========================================
  Hits         1243     1243         0     
+ Misses       2249     2534      +285     

영향받은 파일

이 PR로 영향받은 파일이 없습니다

수정된 모든 파일이 현재 coverage를 유지했습니다.

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

🎨 Storybook Report

ℹ️ Story 변경사항이 감지되지 않았습니다

이 PR에는 Story 변경이 없어서 빌드를 스킵했습니다.

Status Storybook Build Log Updated (UTC)
⏭️ Skipped - - 2025-12-08 08:45:34

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch yoolri-feat/auth-api-mocking

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

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

🚀 PR Preview Report

Build가 성공적으로 완료되었습니다.

Preview에서 변경사항을 확인하세요.

Status Preview Build Log Updated (UTC)
✅ Ready Visit Preview View Logs 2025-12-08 08:47:03

@yoorli yoorli changed the title Yoolri feat/auth api mocking [Feat] 로그인, 회원가입 페이지 api 함수, msw 연결 Dec 8, 2025
@yoorli yoorli added the Ready For Review! 리뷰 받을 준비가 되었습니다. label Dec 8, 2025
Copy link
Member

@Chiman2937 Chiman2937 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

password: value.password,
};

const result = await login(payload);
Copy link
Member

Choose a reason for hiding this comment

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

현재 src/api/index.ts 에서 아래와 같이 export 하고 있기 때문에

export const API = provideAPIService();
Suggested change
const result = await login(payload);
const result = API.authService.login(payload);

이렇게 사용하시면 됩니다!

그러면 아래 구문이 필요없어지거든요

const { login } = authServiceRemote();

src/api/index.ts Outdated
Comment on lines 7 to 9
usersService: userService,
authService: authService,
Copy link
Member

@Chiman2937 Chiman2937 Dec 8, 2025

Choose a reason for hiding this comment

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

지금보니까 제가 작업을 잘못했네요 😭
authService 키와 값이 동일하므로 아래와 같이 변경하면 되겠네용

Suggested change
usersService: userService,
authService: authService,
usersService,
authService,

userService는 추후에 제가 수정하겠습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

중복 호출 수정
@yoorli yoorli merged commit f44e1fc into main Dec 8, 2025
4 checks passed
@yoorli yoorli deleted the yoolri-feat/auth-api-mocking branch December 8, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review! 리뷰 받을 준비가 되었습니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[로그인/회원가입 페이지] auth엔드포인트 API함수 제작

3 participants