Skip to content

feat: 깃허브로 회원가입 시 아이콘 반영#45

Closed
moo1677 wants to merge 2 commits into
devfrom
feature/home-page
Closed

feat: 깃허브로 회원가입 시 아이콘 반영#45
moo1677 wants to merge 2 commits into
devfrom
feature/home-page

Conversation

@moo1677
Copy link
Copy Markdown
Contributor

@moo1677 moo1677 commented Jan 22, 2026

1) 작업한 이슈번호

31

2) 변경 요약 (What & Why)

  • 무엇을 변경했는지: github 회원가입 시 github아이콘을 가져와 아이콘으로 설정
  • 변경했는지(문제/목표):

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

image

전/후 비교, 반응형(모바일/데스크톱) 캡쳐

  • Before:
  • After:

4) 상세 변경사항

  • 라우팅/페이지:
  • 컴포넌트:
  • 상태관리:
  • API 호출:
  • 스타일:
  • 기타:

5) 참고사항

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 사용자 프로필에 GitHub 아바타 이미지가 표시됩니다(프로필 이미지가 없을 경우 기존 텍스트 아이콘 유지).
    • GitHub 연동 가입 시 사용자의 아바타가 프로필에 자동 저장되어 표시됩니다.
    • 외부 아바타 도메인 허용 설정이 추가되어 GitHub 아바타가 원활히 로드됩니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

GitHub에서 받은 avatar_url을 Firestore 사용자 문서에 저장하도록 가입 흐름을 확장하고, Profile 타입에 avatar_url을 추가했으며 ProfileSection 컴포넌트는 uid 프롭을 받아 avatar_url이 있으면 Next.js Image로 아바타를 렌더링하도록 변경했습니다.

Changes

Cohort / File(s) 변경 요약
프로필 데이터 모델
lib/home/profileService.ts
Profile 인터페이스에 avatar_url?: string 필드 추가
프로필 UI 컴포넌트
components/home/ProfileSection.tsx
uid: string 프롭 추가, profile.avatar_url 존재 시 next/imageImage로 아바타 렌더링; 없을 때 기존 텍스트 아이콘 폴백 유지
GitHub 가입 서비스
services/auth/signup.service.ts
GitHub 프로필에서 avatar_url 추출 및 신규 사용자 생성 시 Firestore 문서에 avatar_url 저장; 일부 기존 필드(userId, provider, githubUsername) 제거
Next.js 이미지 설정
next.config.ts
images.domains'avatars.githubusercontent.com' 추가

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20분

Possibly related PRs

Poem

🐰 깡충, 깡충 깡! 깃허브에서 사진을 꺼내왔지,
이미지로 반짝, 프로필이 웃네 😊
uid 들고 달려가, 문서에 새로 적고,
아바타 한 장에 내 마음도 폴짝! 🎨✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경사항의 핵심을 명확하게 설명하고 있습니다. GitHub 회원가입 시 아이콘 반영이라는 주요 변경사항을 간결하게 요약했습니다.
Description check ✅ Passed PR 설명이 대부분의 필수 섹션을 포함하고 있으나, '왜' 변경했는지와 상세 변경사항 섹션이 미완성 상태입니다.
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

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
Copy Markdown

@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: 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?.profileRecord<string, unknown> | undefined 타입이므로, avatar_urlunknown 타입입니다. 타입 단언 또는 유효성 검사가 필요하며, 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',
+      },
+    ],
+  },
 };

Comment thread components/home/ProfileSection.tsx Outdated
Comment thread lib/home/profileService.ts Outdated
Comment thread services/auth/signup.service.ts Outdated
@moo1677 moo1677 closed this Jan 26, 2026
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