Skip to content

26.07.02 애플 로그인 추가 최신화 - #454

Merged
yhi9839 merged 4 commits into
mainfrom
dev
Jul 2, 2026
Merged

yhi9839 merged 4 commits into
mainfrom
dev

Conversation

@shinwokkang

@shinwokkang shinwokkang commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

📌 개요 (Summary)

  • 변경 사항에 대한 간략한 요약을 적어주세요.
  • 관련 이슈가 있다면 링크를 걸어주세요 (예: [fix] cicd / build 문제 #123).

🛠️ 변경 사항 (Changes)

  • 새로운 기능 추가
  • 버그 수정
  • 코드 리팩토링
  • 문서 업데이트
  • 기타 (설명: )

📸 스크린샷 (Screenshots)

(UI 변경 사항이 있다면 첨부해주세요)

✅ 체크리스트 (Checklist)

  • 빌드가 성공적으로 수행되었나요? (pnpm build)
  • 린트 에러가 없나요? (pnpm lint)
  • 불필요한 콘솔 로그나 주석을 제거했나요?

Summary by CodeRabbit

  • New Features

    • Added Apple login support across sign-in and account settings.
    • Displayed Apple as an available social login option with matching branding.
  • Bug Fixes

    • Improved agreement loading so selections update more reliably during signup.
    • Prevented agreement state from being reset unnecessarily while fetching terms.
    • Added a clearer error message when Apple login setup is unavailable.

@shinwokkang shinwokkang self-assigned this Jul 1, 2026
@shinwokkang shinwokkang added the ✨ feat 새로운 기능 추가 label Jul 1, 2026
@vercel

vercel Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
checkmo Ready Ready Preview, Comment Jul 1, 2026 4:22pm

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Apple as a login provider (type, constant, UI styling, and redirect handling via NEXT_PUBLIC_APPLE_AUTH_URL) and reworks the terms-agreement fetch effect and SignupContext's setAgreements to use functional state updates, removing the previous fetch-guard and eliminating an unnecessary effect dependency.

Changes

Apple Login Support

Layer / File(s) Summary
LoginProvider type and SOCIAL_LOGINS constant
src/types/member.ts, src/constants/auth.ts
LoginProvider union gains "APPLE", and SOCIAL_LOGINS array gains an apple entry with icon and alt text.
SocialLoginCard styling and login redirect flow
src/components/base-ui/Settings/SocialLogin/SocialLoginCard.tsx, src/components/base-ui/Login/hooks/useLoginForm.tsx
SocialLoginCard's provider prop derives from Lowercase<LoginProvider> and PROVIDER_STYLES gains an apple style; handleSocialLogin adds an apple branch checking NEXT_PUBLIC_APPLE_AUTH_URL before redirecting or showing an error toast.

Terms Agreement Fetch and State Update Fix

Layer / File(s) Summary
SignupContext functional setAgreements support
src/contexts/SignupContext.tsx
setAgreements type and implementation now accept either a direct record or an updater function applied against previous agreements state.
useTermsAgreement fetch flow rework
src/components/base-ui/Join/steps/TermsAgreement/useTermsAgreement.ts
fetchTerms sets isFetching explicitly, merges terms via functional update for social flow, initializes agreements only when empty for non-social flow, and drops agreements from the effect dependency array.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • checkmo2025/FE#371: Both PRs modify the same SOCIAL_LOGINS constant in src/constants/auth.ts.
  • checkmo2025/FE#393: Both PRs modify useLoginForm.tsx's social login handling logic.
  • checkmo2025/FE#445: The useTermsAgreement/SignupContext agreements rework builds on that PR's terms-mapping architecture.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 애플 로그인 추가라는 핵심 변경을 명확히 반영하고 있어 변경사항과 잘 맞습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 dev

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Apple social login support across the application, including adding the Apple logo SVG, updating authentication constants, types, and login forms, and refactoring the terms agreement hook to use functional state updates. The review feedback highlights potential runtime errors in useTermsAgreement.ts if terms data is undefined, recommending optional chaining, and suggests aligning the Apple login URL assignment in useLoginForm.tsx with other providers for consistency.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +32 to +34
myTerms.terms.forEach(term => {
newAgreements[term.id] = term.agreed;
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

myTerms.terms가 존재하지 않거나 undefined인 경우 forEach 호출 시 런타임 에러(TypeError)가 발생할 수 있습니다. API 응답의 안정성을 위해 옵셔널 체이닝(?.)을 사용하거나 기본값(|| [])을 제공하는 등 방어적 코딩을 적용하는 것이 좋습니다.

Suggested change
myTerms.terms.forEach(term => {
newAgreements[term.id] = term.agreed;
});
myTerms?.terms?.forEach(term => {
newAgreements[term.id] = term.agreed;
});

Comment on lines +47 to +49
terms.forEach(term => {
initialAgreements[term.id] = false;
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

terms가 존재하지 않거나 undefined인 경우 forEach 호출 시 런타임 에러가 발생할 수 있습니다. 안전한 실행을 위해 옵셔널 체이닝(?.)을 사용하거나 기본값(|| [])을 설정하여 방어적으로 처리하는 것이 좋습니다.

Suggested change
terms.forEach(term => {
initialAgreements[term.id] = false;
});
terms?.forEach(term => {
initialAgreements[term.id] = false;
});

Comment on lines +117 to +123
case "apple":
if (!process.env.NEXT_PUBLIC_APPLE_AUTH_URL) {
toast.error("애플 로그인 주소 설정이 누락되었습니다.");
return;
}
authUrl = process.env.NEXT_PUBLIC_APPLE_AUTH_URL;
break;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

다른 소셜 로그인 제공자(Google, Kakao, Naver)들과 동일한 패턴을 유지하여 코드의 일관성과 가독성을 높일 수 있습니다. apple 케이스에서도 환경 변수가 없을 때 빈 문자열을 할당하도록 하고, 하단의 공통 에러 처리 로직(if (authUrl) ... else ...)에서 처리하도록 단순화하는 것을 제안합니다.

      case "apple":
        authUrl = process.env.NEXT_PUBLIC_APPLE_AUTH_URL || "";
        break;

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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)
src/components/base-ui/Join/steps/TermsAgreement/useTermsAgreement.ts (1)

63-68: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Memoize onNext before passing it into TermsAgreement

SignupStepPageClient creates onNext={() => navigateTo(...)} inline, so its identity changes on every render. With onNext in useTermsAgreement’s dependency list, that will re-run the terms fetch and reset the loading state whenever the parent renders. Wrap the callback in useCallback (or move it behind a stable ref) to keep the effect from retriggering.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/base-ui/Join/steps/TermsAgreement/useTermsAgreement.ts` around
lines 63 - 68, The effect in useTermsAgreement is being retriggered because
onNext is an unstable inline callback from SignupStepPageClient, which causes
fetchTerms and loading state resets on every parent render. Memoize the onNext
handler in SignupStepPageClient with useCallback (or store it in a stable ref)
so the function identity stays stable, and keep useTermsAgreement’s dependency
array from re-running unnecessarily.
🧹 Nitpick comments (1)
src/components/base-ui/Login/hooks/useLoginForm.tsx (1)

103-133: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate missing-config handling for apple vs other providers.

The apple case pre-checks and early-returns with a specific toast message, while google/kakao/naver rely on the shared fallback check at Lines 129-133 with a generic message. This is redundant logic producing inconsistent UX depending on provider.

♻️ Proposed consolidation
       case "apple":
-        if (!process.env.NEXT_PUBLIC_APPLE_AUTH_URL) {
-          toast.error("애플 로그인 주소 설정이 누락되었습니다.");
-          return;
-        }
-        authUrl = process.env.NEXT_PUBLIC_APPLE_AUTH_URL;
+        authUrl = process.env.NEXT_PUBLIC_APPLE_AUTH_URL || "";
         break;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/base-ui/Login/hooks/useLoginForm.tsx` around lines 103 - 133,
Consolidate the missing auth URL handling in handleSocialLogin so all providers
use the same flow instead of a special-case apple branch plus the shared
fallback. Remove the apple-specific early return in useLoginForm and centralize
the toast/error handling after the switch, using provider-specific messaging
only if needed; keep the redirect logic in the authUrl check path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/components/base-ui/Join/steps/TermsAgreement/useTermsAgreement.ts`:
- Around line 63-68: The effect in useTermsAgreement is being retriggered
because onNext is an unstable inline callback from SignupStepPageClient, which
causes fetchTerms and loading state resets on every parent render. Memoize the
onNext handler in SignupStepPageClient with useCallback (or store it in a stable
ref) so the function identity stays stable, and keep useTermsAgreement’s
dependency array from re-running unnecessarily.

---

Nitpick comments:
In `@src/components/base-ui/Login/hooks/useLoginForm.tsx`:
- Around line 103-133: Consolidate the missing auth URL handling in
handleSocialLogin so all providers use the same flow instead of a special-case
apple branch plus the shared fallback. Remove the apple-specific early return in
useLoginForm and centralize the toast/error handling after the switch, using
provider-specific messaging only if needed; keep the redirect logic in the
authUrl check path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48558fc1-04fe-436c-8a31-5ab4778feaec

📥 Commits

Reviewing files that changed from the base of the PR and between 56b2dfc and 2bd2719.

⛔ Files ignored due to path filters (1)
  • public/appleLogo.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • src/components/base-ui/Join/steps/TermsAgreement/useTermsAgreement.ts
  • src/components/base-ui/Login/hooks/useLoginForm.tsx
  • src/components/base-ui/Settings/SocialLogin/SocialLoginCard.tsx
  • src/constants/auth.ts
  • src/contexts/SignupContext.tsx
  • src/types/member.ts

@yhi9839
yhi9839 merged commit be1df86 into main Jul 2, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 2bd27190 Deployed Jul 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants