feat: 깃허브로 회원가입 시 아이콘 반영#45
Conversation
📝 WalkthroughWalkthroughGitHub에서 받은 Changes
Sequence Diagram(s)sequenceDiagram
participant Browser
participant NextApp
participant AuthService
participant GitHubOAuth as GitHub
participant Firestore
Browser->>NextApp: "Sign in with GitHub" 요청
NextApp->>GitHub: OAuth 인증 흐름
GitHub-->>NextApp: 사용자 정보 (incl. avatar_url)
NextApp->>AuthService: signupWithGithub(info)
AuthService->>Firestore: 사용자 문서 조회/생성 (nickname, createdAt, avatar_url...)
Firestore-->>AuthService: 생성/응답
AuthService-->>NextApp: 가입 완료 응답
NextApp-->>Browser: 리디렉션 / 로그인 상태
alt 사용자 프로필 표시
Browser->>NextApp: ProfileSection 렌더 요청 (uid)
NextApp->>Firestore: 프로필 조회 (includes avatar_url)
Firestore-->>NextApp: Profile 데이터
NextApp-->>Browser: ProfileSection (if avatar_url -> render Image, else icon)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20분 Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@components/home/ProfileSection.tsx`:
- Line 15: Remove the debug console.log call that prints avatarUrl from the
ProfileSection component; locate the console.log(avatarUrl) statement in
ProfileSection.tsx (inside the ProfileSection render/function) and delete it so
no debug logging remains in production code, or replace it with a conditional
debug helper that runs only in development (e.g., guarded by
process.env.NODE_ENV === 'development') if logging is required.
In `@lib/home/profileService.ts`:
- Line 10: profileService.ts에서 정의한 avatar_url을 필수로 선언해 실제 데이터와 불일치가 발생하므로
avatar_url을 optional로 변경하세요: 해당 파일의 Profile (또는 UserProfile) 타입/인터페이스에서
avatar_url?: string로 바꾸고, signupWithEmail 함수와 다른 소비자(예: getProfile,
updateProfile 등)가 avatar_url이 없을 수 있음을 처리하도록 널/undefined 체크를 추가하세요.
In `@services/auth/signup.service.ts`:
- Line 39: Remove the debug console.log(info) from
services/auth/signup.service.ts; instead either delete the statement or replace
it with a proper logger call (e.g., processLogger.debug or similar) that does
not print sensitive user data, and if logging is required sanitize or redact
sensitive fields from the info object before logging; ensure no plaintext user
credentials or PII are emitted.
🧹 Nitpick comments (3)
services/auth/signup.service.ts (1)
38-38:avatar_url타입 및 undefined 처리가 필요합니다.
info?.profile은Record<string, unknown> | undefined타입이므로,avatar_url은unknown타입입니다. 타입 단언 또는 유효성 검사가 필요하며, undefined일 경우 빈 문자열이나 기본값을 저장하는 것이 좋습니다.♻️ 권장 수정안
- const avatar_url = info?.profile?.avatar_url; + const avatar_url = (info?.profile?.avatar_url as string) ?? '';Also applies to: 50-50
components/home/ProfileSection.tsx (1)
22-34: 중첩된<span>구조를 정리하고 Image 스타일을 개선하세요.
- 외부
<span className="text-3xl">이 불필요하게 중첩되어 있습니다.- Image 컴포넌트에
rounded-full클래스가 없어 원형 프로필 이미지로 표시되지 않습니다.- Image 크기를 컨테이너에 맞게 조정하면 더 일관된 UI를 제공합니다.
♻️ 권장 수정안
<div className="flex h-16 w-16 items-center justify-center overflow-hidden rounded-full border border-gray-100 bg-purple-100 pt-1"> - <span className="text-3xl"> - {avatarUrl ? ( - <Image - src={avatarUrl} - alt="profile avatar" - width={50} - height={50} - className="h-full w-full object-cover" - /> - ) : ( - <span className="text-3xl">{icon}</span> - )} - </span> + {avatarUrl ? ( + <Image + src={avatarUrl} + alt="profile avatar" + width={64} + height={64} + className="h-full w-full rounded-full object-cover" + /> + ) : ( + <span className="text-3xl">{icon}</span> + )} </div>next.config.ts (1)
4-4:images.domains는 deprecated되었습니다.remotePatterns사용을 권장합니다.Next.js 12.3 이후로
domains는 deprecated되었으며,remotePatterns가 더 안전하고 권장되는 방식입니다. 정확한 패턴 매칭과 더 명시적인 설정이 가능합니다.♻️ 권장 수정안
const nextConfig: NextConfig = { - images: { domains: ['avatars.githubusercontent.com'] }, + images: { + remotePatterns: [ + { + protocol: 'https', + hostname: 'avatars.githubusercontent.com', + }, + ], + }, };
1) 작업한 이슈번호
31
2) 변경 요약 (What & Why)
3) 스크린샷/동영상 (UI 변경 시)
4) 상세 변경사항
5) 참고사항
Summary by CodeRabbit
릴리스 노트
✏️ Tip: You can customize this high-level summary in your review settings.