Skip to content

feat: implement Kakao OAuth login functionality#52

Merged
devgony merged 1 commit intoprography:mainfrom
devgony:kakao
Jul 26, 2025
Merged

feat: implement Kakao OAuth login functionality#52
devgony merged 1 commit intoprography:mainfrom
devgony:kakao

Conversation

@devgony
Copy link
Collaborator

@devgony devgony commented Jul 26, 2025

  • Add Kakao OAuth endpoint to constants
  • Implement handleKakaoLogin with proper OAuth flow
  • Add separate loading states for Google and Kakao buttons
  • Fix loading spinner issue where both buttons showed loading state

Summary by CodeRabbit

  • New Features

    • Improved Kakao login experience with dedicated loading state, error handling, and visual feedback during authentication.
    • Kakao login button now displays a loading spinner and is disabled while processing, matching the Google login button behavior.
  • Enhancements

    • More responsive and accurate loading indicators for both Google and Kakao login buttons.

- Add Kakao OAuth endpoint to constants
- Implement handleKakaoLogin with proper OAuth flow
- Add separate loading states for Google and Kakao buttons
- Fix loading spinner issue where both buttons showed loading state
@coderabbitai
Copy link

coderabbitai bot commented Jul 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes introduce separate loading state management for Google and Kakao OAuth login buttons within the onboarding login screen. The Kakao login handler is fully implemented, including CSRF state generation and redirection. Additionally, a Kakao OAuth authorization endpoint constant is added to the application's constants.

Changes

File(s) Change Summary
app/onboarding/_components/LoginScreen.tsx Split loading state into isGoogleLoading and isKakaoLoading; implemented Kakao login handler; updated button UI and error handling.
lib/constants.ts Added KAKAO_AUTHORIZE to OAUTH_ENDPOINTS; added trailing newline.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LoginScreen
    participant KakaoOAuth

    User->>LoginScreen: Click Kakao Login
    LoginScreen->>LoginScreen: Set isKakaoLoading true, save step, generate CSRF state
    LoginScreen->>KakaoOAuth: Redirect to KAKAO_AUTHORIZE with params
    KakaoOAuth-->>User: OAuth flow continues
Loading
sequenceDiagram
    participant User
    participant LoginScreen
    participant GoogleOAuth

    User->>LoginScreen: Click Google Login
    LoginScreen->>LoginScreen: Set isGoogleLoading true, save step, generate CSRF state
    LoginScreen->>GoogleOAuth: Redirect to Google OAuth with params
    GoogleOAuth-->>User: OAuth flow continues
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A bunny hopped to log you in,
With Google or Kakao, let’s begin!
Two spinners now, not just one,
Each button’s loading—oh what fun!
Constants grow, the flow’s refined,
OAuth journeys now aligned.
🥕✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-26T06_17_39_669Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72959fb and 5e40044.

📒 Files selected for processing (2)
  • app/onboarding/_components/LoginScreen.tsx (6 hunks)
  • lib/constants.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@devgony devgony merged commit 10fb85f into prography:main Jul 26, 2025
2 of 3 checks passed
devgony added a commit that referenced this pull request Jul 26, 2025
* Fix mypage (#46)

* fix: improve onboarding redirect logic and implement logout

- Add logout functionality in MyPage component using auth store
- Optimize onboarding page redirect by using useGoals hook with loading state
- Replace window.location.href with Next.js router.replace() for better performance
- Add loading spinner during goal data fetch in onboarding
- Remove SSR/CSR conflicts by moving redirect logic to useEffect

* fix: handle Zustand hydration delay in onboarding page

- Add hydration state check to prevent premature login state evaluation
- Wait 50ms for Zustand persist data to hydrate before checking login status
- Show loading spinner during hydration process
- Add debug console logs for hydration and auth states
- Fix redirect logic to only execute after store has been properly hydrated

* fix: resolve 401 error and smooth onboarding page transitions

- Fix premature API call issue where useGoals was called before login completion
- Add error handling and retry logic for 401 authentication errors
- Use SWR mutate function to retry goals API after successful login
- Improve loading state logic to prevent flickering during page transitions
- Set shouldRetryOnError to false to prevent automatic retries on auth errors
- Show loading spinner until proper authentication and data fetching is complete

* fix: improve loading spinner visibility and eliminate page flash

- Change spinner color from border-primary-500 to border-gray-800 for better visibility on white background
- Add additional loading state for when goals exist and redirect is about to happen
- Prevent brief flash of onboarding content during page transitions
- Show consistent loading spinner during all redirect scenarios

* feat: add useCompletedGoals hook for completed goals API

- Add completedGoals query to useQuery object
- Export useCompletedGoals hook for backward compatibility
- Connect to 목표Api.getCompletedGoals endpoint
- Return CompletedGoalListRs with todo counts and result counts
- Follow existing hook patterns and naming conventions

* refactor: integrate useCompletedGoals hook in DoneItems component

- Replace mock data with real API data using useCompletedGoals hook
- Update interface to use CompletedGoalItemRs from generated API types
- Map API response fields to component display (todoCount, dueDate)
- Remove hardcoded defaultGoals array and use dynamic data
- Maintain existing UI layout and styling patterns

* refactor: clean up component formatting and remove redundant elements

- Remove redundant status bar elements from onboarding components
- Standardize code formatting with Prettier for mypage components
- Clean up whitespace and indentation inconsistencies
- Remove hardcoded status bar time displays
- Maintain consistent React component structure patterns

* feat: integrate real API data in DoneItemDetail component

- Add useGoalWithSubGoalsAndTodos hook to API hooks file
- Update DoneItemDetail to use GoalWithSubGoalTodoRs from API
- Replace mock data with real API data in done item detail page
- Map TodoRs properties to component display (date, todoResult.fileUrl)
- Fix hook naming consistency (goalWithSubGoal vs goalWithSubGoals)
- Remove hardcoded mock goal details and use dynamic data

* fix: update DoneItems statistics display and layout

- Add flex-1 to statistics spans for better layout
- Replace hardcoded 0 with actual todoResultCount for record count

* fix: improve UserProfile edit button styling and accessibility

* feat: sync TextField styling with Figma design

- Update TextField to use design tokens (Color-gray-20, Color-primary-50)
- Add proper border styling with 1px solid border
- Implement correct focus states with ring styling
- Use consistent color scheme matching Figma specifications
- Remove custom color overrides from EditProfile component

* fix: handle empty string in profile image fallback

Changed from ?? to || operator to properly handle both null/undefined and empty string values for profileImageUrl fallback to /profile-default.png

* feat: add save success toast notification to EditProfile

Added toast notification that displays "저장 되었습니다" when user clicks save button in profile edit page. Follows existing toast implementation pattern with 2-second auto-hide duration.

* feat: implement interest selection bottom sheet with Korean localization

- Created InterestSelectionBottomSheet component using vaul library following existing patterns
- Added state management for interest selection in EditProfile component
- Updated UserUpdateRqInterestsEnumToKr converter with correct API enum mappings
- Integrated Korean display for all interest chips in both bottom sheet and main interface
- Added visual feedback with selected interests display and placeholder text
- Maintained type safety with proper TypeScript integration

Interest mappings:
- HEALTH → 건강, READING → 독서, STUDY → 학업, LANGUAGE → 어학
- SPORTS → 운동, PROGRAMMING → 프로그래밍, CAREER → 취업/이직, SELF_IMPROVEMENT → 자기개발

* fix: update EditProfile component styling and functionality

* deleteAccount is not implemeneted alert

* fix: remove non-existent props from EditProfile stories

Remove initialName, initialBio, and profileImageUrl from argTypes and story args as these props don't exist in the EditProfileProps interface. The component gets data from useMyProfile hook instead.

* feat: replace point icon placeholder with money image in PointsDisplay

* fix: resolve TypeScript error in useGoalWithSubGoalTodo hook

Switch from useGoalWithSubGoals to useGoalWithSubGoalsAndTodos to access todos property on SubGoalWithTodosRs type.

* feat: implement feed page with Figma design

Add new /feed route with coming soon message and image from Figma design.
Excludes system status bar as requested.

* refactor: restructure feed page architecture and fix height issues

- Extract FeedPage component to components/feed/
- Follow group page pattern with dynamic BottomTabBar import
- Fix height calculation to prevent scrolling (calc(100vh-56px))
- Add Storybook integration for FeedPage component
- Improve component separation and maintainability

* style: update feed page styling to exactly match Figma design

- Change background from gray to white
- Remove notification button from AppBar
- Add w-full to content container for proper width
- Clean up component styling and formatting

* feat: connect MyPage interests button to EditProfile interests selection

- Update MyPage onAddInterests to navigate to /mypage/edit?openInterests=true
- Add openInterests prop to EditProfile component
- Auto-open interests bottom sheet when openInterests query param is present

* feat: implement profile image upload functionality in EditProfile

- Add file input state and ref for image selection
- Implement handleImageUpload function to process selected files
- Connect edit button to file picker with handleEditImage
- Update onSave callback to pass selected file to parent component
- Add hidden file input with image/* accept filter

* feat: add image preview for profile picture upload

- Add previewUrl state to show selected image immediately
- Update handleImageUpload to create object URL for preview
- Update img src to display preview before save
- Add URL cleanup in useEffect to prevent memory leaks

* style: remove background from profile pictures to fill full circle

- Remove gray background and padding from EditProfile profile image
- Update UserProfile to show full-size images without background
- Keep background only for placeholder icon in UserProfile
- Increase image size to fill the full 100px circle

* style: update MyPage layout to match Figma design

- Add gray background to UserProfile component with proper padding
- Update MyPage layout structure for correct background colors
- Format NavigationList component and improve hover states
- Align profile section styling with Figma specifications

* refactor: replace custom AppBar with shared AppBar component in EditProfile

- Replace custom header implementation with AppBar component
- Use AppBar type="back" with title and onBackClick handler
- Position save button as absolute overlay on right side
- Maintain consistent header height with standardized spacing

* style: update EditProfile layout to match UserProfile styling

- Replace simple profile image section with structured layout
- Add consistent background and padding to profile section
- Use same gap and spacing pattern as UserProfile component
- Maintain visual consistency between profile components

* refactor: simplify UserProfile image handling with fallback

- Remove conditional rendering for profile image
- Use fallback to default profile image when no profileImage provided
- Consistent with EditProfile approach using profile-default.png
- Simplify component logic while maintaining functionality

* feat: update API types with new message features and user deletion

- Add file metadata (fileName, fileMimeType) to TodoResultRs
- Add GoalTitleUpdatedContent and MessageReactionContent types
- Add MESSAGE_REACTION and GOAL_TITLE_UPDATE message types
- Add user deletion endpoint
- Add new goal query endpoint with all todos
- Update group exit response status code

* feat: implement user account deletion functionality

- Replace placeholder alert with actual deleteUser API call
- Add toast notification for deletion confirmation
- Add automatic logout and redirect to home after deletion
- Import required useToast and useAuthStore hooks

* implement todoResult for both completed and incompleted

* refactor: replace manual toast with useToast hook in EditProfile

* fix: wrap useSearchParams in Suspense boundary for EditProfile page

* feat: update button text based on initial interests state

* style: add cursor pointer and improve formatting in EditIcon

* Qa - 파비콘 추가 (#50)

* feat: 파비콘 변경

* feat: implement Kakao OAuth login functionality (#52)

- Add Kakao OAuth endpoint to constants
- Implement handleKakaoLogin with proper OAuth flow
- Add separate loading states for Google and Kakao buttons
- Fix loading spinner issue where both buttons showed loading state

---------

Co-authored-by: SangHyeon Lee <67571350+Hys-Lee@users.noreply.github.com>
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