Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

사용자 인증 추가 #10

Merged
merged 2 commits into from
Feb 5, 2024
Merged

사용자 인증 추가 #10

merged 2 commits into from
Feb 5, 2024

Conversation

tolluset
Copy link
Collaborator

@tolluset tolluset commented Feb 5, 2024

  • 구글 로그인 추가
  • 사용자 테이블 추가, 활동 테이블에 사용자 아이디 컬럼 추가
2024-02-06.8.47.27.mov

Summary by CodeRabbit

  • New Features
    • Implemented user authentication using NextAuth with Google as a provider.
    • Added image optimization for remote images from specific domains.
    • Activities can now be filtered by user ID, enhancing personalized content.
  • Enhancements
    • Expanded environment configurations to support Google OAuth and database connections.
  • Database
    • Introduced new database schema for handling activities, sessions, and user information.
  • Refactor
    • Enhanced authentication checks across the application, including redirection for unauthenticated users.
  • Documentation
    • Added new constants and types to improve code readability and maintainability.

Copy link
Contributor

coderabbitai bot commented Feb 5, 2024

Walkthrough

The project has been updated to include authentication and user-specific data handling. Changes involve configuring image domains, adding user identification to activities, implementing authentication with NextAuth using Google as a provider, and setting up database schemas for user-related operations. This ensures that activities are filtered by user ID, and only authenticated users can access certain functionalities.

Changes

File(s) Change Summary
next.config.js Added configuration for remote images from "lh3.googleusercontent.com".
src/app/activities/model.ts Added userId field to Activity type.
src/app/activities/repository.ts, src/lib/auth.ts Integrated authentication checks and modified queries for user ID filtering.
src/app/api/auth/[...nextauth]/route.ts, src/app/page.tsx, src/constants/route.ts Implemented authentication flow and redirection for unauthenticated access.
src/constants/env.ts Expanded to include Google and database configurations.
src/lib/ddl.sql Introduced database schema for user-related tables.
src/types/auth.ts Customized session user data structure with an additional id field.

Poem

🐇✨
In the realm of code, a change we weave,
Authentication flows, in Next.js we believe.
With user IDs, activities now gleam,
A secure web garden, our developers' dream.
🌱🔒

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit-tests for this file.
  • 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 generate unit tests for this file.
    • @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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

sonarcloud bot commented Feb 5, 2024

Copy link
Contributor

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a10a2f4 and 9f3d99f.
Files ignored due to path filters (2)
  • package.json is excluded by: !**/*.json
  • pnpm-lock.yaml is excluded by: !**/*.yaml
Files selected for processing (10)
  • next.config.js (1 hunks)
  • src/app/activities/model.ts (1 hunks)
  • src/app/activities/repository.ts (2 hunks)
  • src/app/api/auth/[...nextauth]/route.ts (1 hunks)
  • src/app/page.tsx (1 hunks)
  • src/constants/env.ts (1 hunks)
  • src/constants/route.ts (1 hunks)
  • src/lib/auth.ts (1 hunks)
  • src/lib/ddl.sql (1 hunks)
  • src/types/auth.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/constants/route.ts
Additional comments: 9
src/app/api/auth/[...nextauth]/route.ts (1)
  • 1-6: LGTM!
src/types/auth.ts (1)
  • 1-9: LGTM!
src/constants/env.ts (1)
  • 6-18: LGTM!
next.config.js (1)
  • 3-9: LGTM!
src/app/page.tsx (1)
  • 4-15: LGTM!
src/lib/ddl.sql (1)
  • 1-67: LGTM!
src/app/activities/model.ts (1)
  • 8-8: LGTM!
src/lib/auth.ts (1)
  • 1-69: LGTM!
src/app/activities/repository.ts (1)
  • 24-70: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [3-68]

LGTM!

@tolluset tolluset merged commit 9a2d845 into main Feb 5, 2024
2 checks passed
@tolluset tolluset deleted the feat/9/auth branch February 5, 2024 23:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant