Skip to content

Conversation

@minkyung5x5
Copy link
Contributor

@minkyung5x5 minkyung5x5 commented Nov 12, 2024

๐Ÿ”– Issue Ticket

Ticket

โœ๏ธ Description

๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž… API ์—ฐ๊ฒฐ
ํผ ์—๋Ÿฌ์ฒ˜๋ฆฌ

โœ… Checklist

PR

  • Branch Convention ํ™•์ธ

    feat/ ํ”ผ์ณ, fix/ ๋ฒ„๊ทธ ์ˆ˜์ •, refactor/ ๊ฐœ์„ 

  • Base Branch ํ™•์ธ
  • ์ ์ ˆํ•œ Label ์ง€์ •
  • Assignee ๋ฐ Reviewer ์ง€์ •

Test

  • ๋กœ์ปฌ ์ž‘๋™ ํ™•์ธ

Summary by CodeRabbit

  • New Features

    • ๋™์  URL ์žฌ์ž‘์„ฑ ๊ธฐ๋Šฅ ์ถ”๊ฐ€๋กœ ๋ผ์šฐํŒ… ๋Šฅ๋ ฅ ํ–ฅ์ƒ.
    • ์‚ฌ์šฉ์ž ์ธ์ฆ ํ๋ฆ„ ๊ฐœ์„ ์„ ์œ„ํ•œ ์ƒˆ๋กœ์šด ๋ฉ”์„œ๋“œ setUser ๋„์ž….
  • Bug Fixes

    • ๋กœ๊ทธ์ธ ๋ฐ ํšŒ์›๊ฐ€์ž… ์‹œ ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ๋กœ์ง ๊ฐœ์„ ์œผ๋กœ ๋” ๋™์ ์ธ ์˜ค๋ฅ˜ ๊ด€๋ฆฌ ๊ฐ€๋Šฅ.
  • Documentation

    • API ์‘๋‹ต ์ฒ˜๋ฆฌ ๋ฐฉ์‹ ๋ณ€๊ฒฝ์œผ๋กœ ์ธ์ฆ ํ† ํฐ ๊ด€๋ฆฌ ๊ฐœ์„ .
  • Chores

    • API ์—”๋“œํฌ์ธํŠธ ๊ฒฝ๋กœ ํ‘œ์ค€ํ™” ๋ฐ ์‘๋‹ต ์ฒ˜๋ฆฌ ๊ฐœ์„ .
    • CI ์›Œํฌํ”Œ๋กœ์šฐ์— ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์ถ”๊ฐ€๋กœ ๋นŒ๋“œ ํ”„๋กœ์„ธ์Šค ๊ฐœ์„ .

@coderabbitai
Copy link

coderabbitai bot commented Nov 12, 2024

Walkthrough

์ด๋ฒˆ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์€ Next.js ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๋ผ์šฐํŒ… ๋ฐ ์ธ์ฆ ํ๋ฆ„์„ ๊ฐœ์„ ํ•˜๋Š” ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ๊ธฐ๋Šฅ์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. next.config.mjs ํŒŒ์ผ์— ๋น„๋™๊ธฐ ๋ฉ”์„œ๋“œ rewrites๊ฐ€ ์ถ”๊ฐ€๋˜์–ด ๋ชจ๋“  ์š”์ฒญ์„ ํ™˜๊ฒฝ ๋ณ€์ˆ˜์— ๊ธฐ๋ฐ˜ํ•œ URL๋กœ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธํ•ฉ๋‹ˆ๋‹ค. API ํ˜ธ์ถœ์„ ์œ„ํ•œ ์—”๋“œํฌ์ธํŠธ๊ฐ€ ์—…๋ฐ์ดํŠธ๋˜๊ณ , ์‘๋‹ต ์ฒ˜๋ฆฌ ๋ฐฉ์‹์ด ๊ฐœ์„ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ, ๋กœ๊ทธ์ธ ๋ฐ ํšŒ์›๊ฐ€์ž… ๊ณผ์ •์—์„œ์˜ ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ๋กœ์ง์ด ๊ฐ•ํ™”๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ „์ฒด์ ์œผ๋กœ API ์ƒํ˜ธ์ž‘์šฉ ๋ฐ ์ƒํƒœ ๊ด€๋ฆฌ ๋ฐฉ์‹์ด ํ‘œ์ค€ํ™”๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Changes

ํŒŒ์ผ ๊ฒฝ๋กœ ๋ณ€๊ฒฝ ์š”์•ฝ
next.config.mjs nextConfig ๊ฐ์ฒด์— ๋น„๋™๊ธฐ ๋ฉ”์„œ๋“œ rewrites ์ถ”๊ฐ€, ๋ชจ๋“  ์š”์ฒญ์„ NEXT_PUBLIC_API_BASE_URL์— ๊ธฐ๋ฐ˜ํ•œ URL๋กœ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ. headers ๋ฉ”์„œ๋“œ๋Š” ๋ณ€๊ฒฝ ์—†์Œ.
src/_apis/auth/auth-apis.tsx signupUser, loginUser, getUser ํ•จ์ˆ˜์˜ API ์—”๋“œํฌ์ธํŠธ ๋ณ€๊ฒฝ ๋ฐ ์‘๋‹ต ์ฒ˜๋ฆฌ ๊ฐœ์„ . signupUser์™€ loginUser๋Š” ์ด์ œ ์‘๋‹ต์—์„œ Authorization ํ† ํฐ์„ ์ถ”์ถœํ•˜์—ฌ ๋ฐ˜ํ™˜.
src/_queries/auth/auth-queries.tsx usePostSignupQuery, usePostLoginQuery์—์„œ ApiError์˜ ์ž„ํฌํŠธ ๊ฒฝ๋กœ ๋ณ€๊ฒฝ, setUser๋ฅผ ํฌํ•จํ•œ useAuthStore ํ›…์˜ ๊ตฌ์กฐ ๋ณ€๊ฒฝ, ์‘๋‹ต ๋ฐ์ดํ„ฐ์—์„œ ๋™์ ์œผ๋กœ ํ† ํฐ์„ ์ถ”์ถœํ•˜๋„๋ก ์ˆ˜์ •.
src/app/(auth)/login/page.tsx handleSubmit ํ•จ์ˆ˜์˜ ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ๋กœ์ง ์ˆ˜์ •, 404 ์ƒํƒœ ์ฝ”๋“œ ์ฒ˜๋ฆฌ ์ œ๊ฑฐ, 401 ์ƒํƒœ์— ๋Œ€ํ•œ ๋™์  ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ๊ตฌํ˜„.
src/app/(auth)/signup/page.tsx handleSubmit์—์„œ confirmPassword๋ฅผ ์ œ์™ธํ•œ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ ๋ณ€๊ฒฝ, ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ๋กœ์ง์—์„œ error.status ์‚ฌ์šฉ์œผ๋กœ ์ˆ˜์ •.
src/store/use-auth-store.tsx AuthState ์ธํ„ฐํŽ˜์ด์Šค์˜ login ๋ฉ”์„œ๋“œ ์‹œ๊ทธ๋‹ˆ์ฒ˜ ๋ณ€๊ฒฝ, ์ƒˆ๋กœ์šด setUser ๋ฉ”์„œ๋“œ ์ถ”๊ฐ€.
src/types/auth.ts SignupResponse ๋ฐ LoginResponse ์ธํ„ฐํŽ˜์ด์Šค์˜ token ์†์„ฑ ํƒ€์ž…์„ string์—์„œ `string
src/utils/api.ts ApiError ํด๋ž˜์Šค์— detail ์†์„ฑ ์ถ”๊ฐ€ ๋ฐ fetchApi ํ•จ์ˆ˜์˜ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ๋กœ์ง ๊ฐœ์„ . API ์š”์ฒญ ์‹œ ๊ธฐ๋ณธ URL ์ œ๊ฑฐ, ์‘๋‹ต ์ฒ˜๋ฆฌ ๋ฐฉ์‹ ์ˆ˜์ •.
src/app/(auth)/layout.tsx AuthLayout ์ปดํฌ๋„ŒํŠธ์˜ ๋ ˆ์ด์•„์›ƒ ๊ตฌ์กฐ ๋ฐ CSS ํด๋ž˜์Šค ์ˆ˜์ •. ์ด๋ฏธ์ง€ ์ปจํ…Œ์ด๋„ˆ์˜ ๋„ˆ๋น„ ๋ฐ ํŒจ๋”ฉ ํด๋ž˜์Šค ๋ณ€๊ฒฝ, ์ž์‹ ์ปจํ…Œ์ด๋„ˆ์˜ ๋„ˆ๋น„ ์กฐ์ •.
.github/workflows/ci.yml CI ์›Œํฌํ”Œ๋กœ์šฐ ๊ตฌ์„ฑ ์ˆ˜์ •, build ์ž‘์—…์— ํ™˜๊ฒฝ ๋ณ€์ˆ˜ NEXT_PUBLIC_API_BASE_URL ์ถ”๊ฐ€, ๋‹จ๊ณ„ ์ด๋ฆ„ ๋ณ€๊ฒฝ ๋ฐ ์บ์‹œ ํ‚ค ํŒจํ„ด ์ˆ˜์ •.
src/components/common/header/header.stories.tsx Template ํ•จ์ˆ˜์—์„œ useAuthStore ํ›…์— setUser ๋ฉ”์„œ๋“œ ์ถ”๊ฐ€, login ๋ฉ”์„œ๋“œ ์ˆ˜์ •ํ•˜์—ฌ testToken๋งŒ ์ธ์ˆ˜๋กœ ๋ฐ›๋„๋ก ๋ณ€๊ฒฝ.

Suggested labels

api, fix

Suggested reviewers

  • yulrang
  • HaeJungg
  • Rangbyeolang

๐Ÿฐ ๋ณ€ํ™”์˜ ๋ฐ”๋žŒ์ด ๋ถˆ์–ด์™€
์ƒˆ๋กœ์šด ๊ธธ์„ ์—ด์–ด์ฃผ๋„ค
URL์ด ์ถค์ถ”๊ณ , ์˜ค๋ฅ˜๋Š” ์‚ฌ๋ผ์ ธ
์ธ์ฆ์˜ ๋ฌธ์ด ํ™œ์ง ์—ด๋ ค
๋ชจ๋‘ ํ•จ๊ป˜ ์†์žก๊ณ  ๋‚˜์•„๊ฐ€์ž! ๐ŸŒŸ

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.

src/_queries/auth/auth-queries.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't determine the plugin "react-hooks" uniquely.

  • /node_modules/eslint-plugin-react-hooks/index.js (loaded in ".eslintrc.js")
  • /node_modules/eslint-config-next/node_modules/eslint-plugin-react-hooks/index.js (loaded in ".eslintrc.js ยป eslint-config-next/core-web-vitals ยป /node_modules/eslint-config-next/index.js ยป plugin:react-hooks/recommended")

Please remove the "plugins" setting from either config or remove either plugin installation.

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.


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>, please review it.
    • Generate unit testing code for this file.
    • 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 generate unit testing code 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 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 generate unit testing code.
    • @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.

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

@github-actions
Copy link

Copy link

@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: 5

๐Ÿงน Outside diff range and nitpick comments (6)
src/types/auth.ts (1)

Line range hint 1-24: ์ธํ„ฐํŽ˜์ด์Šค์— JSDoc ์ฃผ์„ ์ถ”๊ฐ€ ๊ถŒ์žฅ

๊ฐ ์ธํ„ฐํŽ˜์ด์Šค์˜ ๋ชฉ์ ๊ณผ ์†์„ฑ์— ๋Œ€ํ•œ ์„ค๋ช…์„ JSDoc ํ˜•์‹์œผ๋กœ ์ถ”๊ฐ€ํ•˜๋ฉด ์ฝ”๋“œ์˜ ๊ฐ€๋…์„ฑ๊ณผ ์œ ์ง€๋ณด์ˆ˜์„ฑ์ด ํ–ฅ์ƒ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์˜ˆ์‹œ:

+/**
+ * ํšŒ์›๊ฐ€์ž… ์‘๋‹ต ์ธํ„ฐํŽ˜์ด์Šค
+ * @property {string | null} token - ์ธ์ฆ ์„ฑ๊ณต ์‹œ JWT ํ† ํฐ, ์‹คํŒจ ์‹œ null
+ */
 export interface SignupResponse {
   token: string | null;
 }

+/**
+ * ํšŒ์›๊ฐ€์ž… ์š”์ฒญ ์ธํ„ฐํŽ˜์ด์Šค
+ * @property {string} nickname - ์‚ฌ์šฉ์ž ๋‹‰๋„ค์ž„
+ * @property {string} email - ์‚ฌ์šฉ์ž ์ด๋ฉ”์ผ
+ * @property {string} password - ์‚ฌ์šฉ์ž ๋น„๋ฐ€๋ฒˆํ˜ธ
+ */
 export interface SignupRequest {
   nickname: string;
   email: string;
   password: string;
 }
src/store/use-auth-store.tsx (1)

20-24: ํ† ํฐ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์ถ”๊ฐ€๋ฅผ ๊ณ ๋ คํ•ด์ฃผ์„ธ์š”

ํ˜„์žฌ ๊ตฌํ˜„์€ ๊ธฐ๋Šฅ์ ์œผ๋กœ๋Š” ๋ฌธ์ œ๊ฐ€ ์—†์œผ๋‚˜, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐœ์„ ์‚ฌํ•ญ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

-      login: (token) =>
+      login: (token: string) =>
+        if (!token) {
+          throw new Error('ํ† ํฐ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค');
+        }
         set({
           isAuth: true,
           token,
         }),

๋˜ํ•œ setUser ๋ฉ”์„œ๋“œ์—๋„ ์œ ์‚ฌํ•œ ๊ฒ€์ฆ์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค:

-      setUser: (user: User) => set((state) => ({ ...state, user })),
+      setUser: (user: User) => {
+        if (!user) {
+          throw new Error('์‚ฌ์šฉ์ž ์ •๋ณด๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค');
+        }
+        set((state) => ({ ...state, user }));
+      },

Also applies to: 31-31

src/app/(auth)/signup/page.tsx (2)

Line range hint 11-11: ์ปดํฌ๋„ŒํŠธ ์ด๋ฆ„์ด ๊ธฐ๋Šฅ๊ณผ ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค

ํšŒ์›๊ฐ€์ž… ํŽ˜์ด์ง€๋ฅผ ๋‹ด๋‹นํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ์˜ ์ด๋ฆ„์ด LoginPage๋กœ ๋˜์–ด์žˆ์–ด ํ˜ผ๋ž€์„ ์•ผ๊ธฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ปดํฌ๋„ŒํŠธ์˜ ์‹ค์ œ ๊ธฐ๋Šฅ๊ณผ ์ผ์น˜ํ•˜๋„๋ก ์ด๋ฆ„์„ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

-export default function LoginPage() {
+export default function SignupPage() {

19-23: ์„ฑ๊ณต ์ฒ˜๋ฆฌ ๋กœ์ง ๊ฒ€ํ† ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

ํšŒ์›๊ฐ€์ž… ์„ฑ๊ณต ์‹œ ๋ฐ”๋กœ ๋ฉ”์ธ ํŽ˜์ด์ง€('/')๋กœ ์ด๋™ํ•˜๊ธฐ ์ „์— ์‚ฌ์šฉ์ž์—๊ฒŒ ์„ฑ๊ณต ๋ฉ”์‹œ์ง€๋ฅผ ํ‘œ์‹œํ•˜๊ฑฐ๋‚˜, ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€๋กœ ๋ฆฌ๋‹ค์ด๋ ‰์…˜ ํ•˜๋Š” ๊ฒƒ์ด ๋” ๋‚˜์€ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์„ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐœ์„ ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

 postSignup(requestData, {
   onSuccess: () => {
-    router.push('/');
+    // ํ† ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ํ‘œ์‹œ
+    toast.success('ํšŒ์›๊ฐ€์ž…์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋กœ๊ทธ์ธํ•ด ์ฃผ์„ธ์š”.');
+    // ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€๋กœ ๋ฆฌ๋‹ค์ด๋ ‰์…˜
+    router.push('/login');
   },
   onError: (error) => {
src/utils/api.ts (2)

4-14: ApiError ํด๋ž˜์Šค ๊ตฌํ˜„์ด ์ž˜ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!

validation ์—๋Ÿฌ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ๊ตฌ์กฐ๊ฐ€ ์ž˜ ์„ค๊ณ„๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ, ํด๋ž˜์Šค์™€ ๋ฉ”์„œ๋“œ์— ๋Œ€ํ•œ JSDoc ๋ฌธ์„œํ™”๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ฌธ์„œํ™”๋ฅผ ์ถ”๊ฐ€ํ•ด๋ณด์„ธ์š”:

+/**
+ * API ์š”์ฒญ ์ค‘ ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ํด๋ž˜์Šค
+ * @property {number} status - HTTP ์ƒํƒœ ์ฝ”๋“œ
+ * @property {Object} detail - ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์—๋Ÿฌ ์ƒ์„ธ ์ •๋ณด
+ */
 export class ApiError extends Error {
   detail: { validationErrors: Record<string, string> } = { validationErrors: {} };

+  /**
+   * @param {number} status - HTTP ์ƒํƒœ ์ฝ”๋“œ
+   * @param {string} message - ์—๋Ÿฌ ๋ฉ”์‹œ์ง€
+   * @param {Object} detail - ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์—๋Ÿฌ ์ƒ์„ธ ์ •๋ณด
+   */
   constructor(
     public status: number,
     message: string,
     detail?: { validationErrors: Record<string, string> },
   ) {

38-54: ์—๋Ÿฌ ์ฒ˜๋ฆฌ ๋กœ์ง์ด ๊ฐœ์„ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค๋งŒ, ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋ฅผ ๋” ๋ช…ํ™•ํ•˜๊ฒŒ ๋งŒ๋“ค์–ด๋ณด์„ธ์š”.

์ „๋ฐ˜์ ์ธ ๊ตฌํ˜„์ด ์ž˜ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ, ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์ฒ˜๋ฆฌ๋ฅผ ๋” ๊ตฌ์ฒด์ ์œผ๋กœ ๊ฐœ์„ ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐœ์„ ํ•ด๋ณด์„ธ์š”:

       try {
         const { status, message, ...detail } = await response.json();
-        errorMessage = message || `HTTP error! status: ${response.status}`;
+        errorMessage = message || `์„œ๋ฒ„ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. (์ƒํƒœ ์ฝ”๋“œ: ${response.status})`;
         errorDetail = detail;
       } catch {
-        errorMessage = `HTTP error! status: ${response.status}`;
+        errorMessage = `์„œ๋ฒ„ ์‘๋‹ต์„ ์ฒ˜๋ฆฌํ•˜๋Š” ์ค‘ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. (์ƒํƒœ ์ฝ”๋“œ: ${response.status})`;
       }
๐Ÿ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 5bb737f and ad5a1db.

๐Ÿ“’ Files selected for processing (8)
  • next.config.mjs (1 hunks)
  • src/_apis/auth/auth-apis.tsx (1 hunks)
  • src/_queries/auth/auth-queries.tsx (1 hunks)
  • src/app/(auth)/login/page.tsx (1 hunks)
  • src/app/(auth)/signup/page.tsx (1 hunks)
  • src/store/use-auth-store.tsx (3 hunks)
  • src/types/auth.ts (2 hunks)
  • src/utils/api.ts (2 hunks)
๐Ÿ”‡ Additional comments (12)
src/types/auth.ts (1)

2-2: ํ† ํฐ ํƒ€์ž… ๋ณ€๊ฒฝ์ด ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค

string | null ํƒ€์ž…์œผ๋กœ ๋ณ€๊ฒฝํ•œ ๊ฒƒ์€ ์ธ์ฆ ์‹คํŒจ ์‹œ๋‚˜๋ฆฌ์˜ค๋ฅผ ๋” ๋ช…ํ™•ํ•˜๊ฒŒ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋ฉฐ, API ์‘๋‹ต ์ฒ˜๋ฆฌ๋ฅผ ๊ฐœ์„ ํ•˜๋Š”๋ฐ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค.

Also applies to: 12-12

src/store/use-auth-store.tsx (2)

9-9: ์ธํ„ฐํŽ˜์ด์Šค ๋ณ€๊ฒฝ์ด ์ž˜ ์ด๋ฃจ์–ด์กŒ์Šต๋‹ˆ๋‹ค!

ํ† ํฐ๊ณผ ์‚ฌ์šฉ์ž ์ •๋ณด ๊ด€๋ฆฌ๋ฅผ ๋ถ„๋ฆฌํ•œ ๊ฒƒ์€ ์ข‹์€ ์„ค๊ณ„ ๊ฒฐ์ •์ž…๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด:

  • ํ† ํฐ ๊ธฐ๋ฐ˜ ์ธ์ฆ๊ณผ ์‚ฌ์šฉ์ž ์ •๋ณด ๊ด€๋ฆฌ๋ฅผ ๋…๋ฆฝ์ ์œผ๋กœ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
  • API ์‘๋‹ต ์ฒ˜๋ฆฌ ์‹œ ๋” ์œ ์—ฐํ•œ ์ƒํƒœ ๊ด€๋ฆฌ๊ฐ€ ๊ฐ€๋Šฅํ•ด์ง‘๋‹ˆ๋‹ค

Also applies to: 11-11


Line range hint 34-41: ์˜๊ตฌ ์ €์žฅ์†Œ ์„ค์ •์ด ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค

์„ธ์…˜ ์Šคํ† ๋ฆฌ์ง€ ์‚ฌ์šฉ๊ณผ ์ €์žฅํ•  ์ƒํƒœ ํ•„๋“œ ์„ ํƒ์ด ๋ณด์•ˆ์ ์œผ๋กœ ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค. ํŠนํžˆ:

  • ์„ธ์…˜ ์Šคํ† ๋ฆฌ์ง€๋Š” ์ธ์ฆ ๋ฐ์ดํ„ฐ์— ์ ํ•ฉํ•œ ์„ ํƒ์ž…๋‹ˆ๋‹ค
  • ํ•„์š”ํ•œ ์ƒํƒœ๋งŒ ์„ ๋ณ„์ ์œผ๋กœ ์ €์žฅ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค
next.config.mjs (2)

33-40: ๋ณด์•ˆ ๋ฐ ๊ตฌ์„ฑ ๊ด€๋ จ ๊ฒ€ํ†  ํ•„์š”

๋ชจ๋“  ๊ฒฝ๋กœ๋ฅผ ์™ธ๋ถ€ API๋กœ ๋ฆฌ๋‹ค์ด๋ ‰์…˜ํ•˜๋Š” ํ˜„์žฌ ๊ตฌํ˜„ ๋ฐฉ์‹์— ๋Œ€ํ•ด ๋ช‡ ๊ฐ€์ง€ ๊ณ ๋ ค์‚ฌํ•ญ์ด ์žˆ์Šต๋‹ˆ๋‹ค:

  1. /:path* ํŒจํ„ด์€ ๋ชจ๋“  ์š”์ฒญ์„ ์™ธ๋ถ€ API๋กœ ์ „๋‹ฌํ•˜๋ฏ€๋กœ ๋ณด์•ˆ์ƒ ์œ„ํ—˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  2. ํ™˜๊ฒฝ ๋ณ€์ˆ˜๊ฐ€ ์—†์„ ๊ฒฝ์šฐ์˜ ๋Œ€์ฒด ๋กœ์ง(fallback)์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐœ์„ ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

  async rewrites() {
+   const apiBaseUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
+   if (!apiBaseUrl) {
+     throw new Error('NEXT_PUBLIC_API_BASE_URL is not defined');
+   }
    return [
      {
-       source: '/:path*',
+       source: '/api/:path*',
        destination: `${process.env.NEXT_PUBLIC_API_BASE_URL}/:path*`,
      },
    ];
  },

33-40: CORS ์„ค์ •๊ณผ์˜ ์—ฐ๊ด€์„ฑ ๊ฒ€ํ†  ํ•„์š”

ํ˜„์žฌ headers()์™€ rewrites() ๋ฉ”์„œ๋“œ๊ฐ€ ๋™์ผํ•œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. CORS ์„ค์ •์ด ๋ฆฌ๋‹ค์ด๋ ‰์…˜๋œ ์š”์ฒญ์—๋„ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ ์šฉ๋˜๋Š”์ง€ ํ™•์ธ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

src/_apis/auth/auth-apis.tsx (1)

Line range hint 31-36: ์ธ์ฆ ํ† ํฐ์ด ์š”์ฒญ ํ—ค๋”์— ํฌํ•จ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค

์‚ฌ์šฉ์ž ์ •๋ณด๋ฅผ ์กฐํšŒํ•˜๋Š” ๋ณดํ˜ธ๋œ ์—”๋“œํฌ์ธํŠธ์— ์ ‘๊ทผํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์ธ์ฆ ํ† ํฐ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

  return fetchApi<{ data: User }>('/auths/user', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
+     'Authorization': `Bearer ${token}`, // ์ €์žฅ๋œ ํ† ํฐ์„ ์‚ฌ์šฉ
    },
  });
src/app/(auth)/login/page.tsx (2)

22-28: ์„œ๋ฒ„ ์‘๋‹ต ๊ตฌ์กฐ ๊ฒ€์ฆ ํ•„์š”

ํ˜„์žฌ ๊ตฌํ˜„์€ ์„œ๋ฒ„์—์„œ ํŠน์ • ํ˜•ํƒœ์˜ ์—๋Ÿฌ ์‘๋‹ต์„ ๊ฐ€์ •ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์„œ๋ฒ„ ์‘๋‹ต ๊ตฌ์กฐ๊ฐ€ ๋ณ€๊ฒฝ๋  ๊ฒฝ์šฐ ํด๋ผ์ด์–ธํŠธ ์ฝ”๋“œ๊ฐ€ ๊นจ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์„œ๋ฒ„์˜ ์—๋Ÿฌ ์‘๋‹ต ๊ตฌ์กฐ๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•ด์ฃผ์„ธ์š”:

#!/bin/bash
# Description: API ์—๋Ÿฌ ์‘๋‹ต ๊ตฌ์กฐ ํ™•์ธ

# API ๊ด€๋ จ ํƒ€์ž… ์ •์˜ ๊ฒ€์ƒ‰
rg -t typescript "interface.*ApiError|type.*ApiError" 

# ์—๋Ÿฌ ์ฒ˜๋ฆฌ ๊ด€๋ จ ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜ ๊ฒ€์ƒ‰
rg -t typescript "function.*handleError|function.*createError"

22-28: ์ผ๊ด€๋œ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ํŒจํ„ด ์ ์šฉ ํ•„์š”

๋กœ๊ทธ์ธ ํŽ˜์ด์ง€์˜ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ํŒจํ„ด์ด ๋‹ค๋ฅธ ์ธ์ฆ ๊ด€๋ จ ํŽ˜์ด์ง€๋“ค๊ณผ ์ผ๊ด€์„ฑ์ด ์žˆ๋Š”์ง€ ํ™•์ธ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค๋ฅธ ์ธ์ฆ ํŽ˜์ด์ง€๋“ค์˜ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ํŒจํ„ด์„ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•ด์ฃผ์„ธ์š”:

src/app/(auth)/signup/page.tsx (1)

17-18: ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ ๊ฐœ์„ ์ด ์ž˜ ์ด๋ฃจ์–ด์กŒ์Šต๋‹ˆ๋‹ค

confirmPassword๋ฅผ API ์š”์ฒญ ๋ฐ์ดํ„ฐ์—์„œ ์ œ์™ธํ•˜๋Š” ์ฒ˜๋ฆฌ๊ฐ€ ๊น”๋”ํ•˜๊ฒŒ ๊ตฌํ˜„๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์Šคํ”„๋ ˆ๋“œ ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•œ ๊ตฌ์กฐ ๋ถ„ํ•ด๊ฐ€ ๊ฐ€๋…์„ฑ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

src/_queries/auth/auth-queries.tsx (2)

4-4: ์ปค์Šคํ…€ ApiError ํƒ€์ž…์œผ๋กœ์˜ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜์ด ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค.

๋กœ์ปฌ ์œ ํ‹ธ๋ฆฌํ‹ฐ์—์„œ ApiError๋ฅผ ์ž„ํฌํŠธํ•˜๋„๋ก ๋ณ€๊ฒฝํ•œ ๊ฒƒ์€ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๋ฅผ ๋” ์ฒด๊ณ„์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค.


10-10: ํ† ํฐ ์ฒ˜๋ฆฌ ๋ฐ ์ƒํƒœ ๊ด€๋ฆฌ ๋กœ์ง ๊ฒ€ํ† ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

ํ† ํฐ ์ฒ˜๋ฆฌ์™€ ์‚ฌ์šฉ์ž ์ƒํƒœ ๊ด€๋ฆฌ๊ฐ€ ๋ถ„๋ฆฌ๋˜์–ด ๊ฐœ์„ ๋˜์—ˆ์œผ๋‚˜, ๋‹ค์Œ ์‚ฌํ•ญ๋“ค์„ ๊ณ ๋ คํ•ด์ฃผ์„ธ์š”:

  1. ํ† ํฐ์ด ์—†๋Š” ๊ฒฝ์šฐ์˜ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
  2. ์ƒํƒœ ์—…๋ฐ์ดํŠธ ์‹คํŒจ ์‹œ์˜ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐœ์„ ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

  onSuccess: async (response) => {
    const token = response.data.token?.replace(/^Bearer\s/, '');
-   if (token) await login(token);
+   if (!token) {
+     throw new Error('ํ† ํฐ์ด ์—†์Šต๋‹ˆ๋‹ค');
+   }
+   
+   try {
+     await login(token);
+     const user: User = await queryClient.fetchQuery(getUserQuery());
+     setUser(user);
+   } catch (error) {
+     console.error('์‚ฌ์šฉ์ž ์ƒํƒœ ์—…๋ฐ์ดํŠธ ์‹คํŒจ:', error);
+     throw error;
+   }
-   const user: User = await queryClient.fetchQuery(getUserQuery());
-   setUser(user);
  },

Also applies to: 15-19

src/utils/api.ts (1)

38-38: API ๊ธฐ๋ณธ URL ์„ค์ •์ด ์ œ๊ฑฐ๋œ ๊ฒƒ์ด ์˜๋„๋œ ๋ณ€๊ฒฝ์ธ์ง€ ํ™•์ธํ•ด์ฃผ์„ธ์š”.

๊ธฐ์กด base URL ์—ฐ๊ฒฐ์ด ์ œ๊ฑฐ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  API ํ˜ธ์ถœ ๋ถ€๋ถ„์—์„œ ์™„์ „ํ•œ URL์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ๋กœ API URL ์‚ฌ์šฉ์„ ํ™•์ธํ•ด๋ณด์„ธ์š”:

โœ… Verification successful

Let me search for fetch calls and URL construction patterns to verify the API URL usage.


API URL ์„ค์ •์ด ์˜๋„์ ์œผ๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ฝ”๋“œ ๋ถ„์„ ๊ฒฐ๊ณผ, fetchApi ํ•จ์ˆ˜๋Š” ์ƒ๋Œ€ ๊ฒฝ๋กœ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ API๋ฅผ ํ˜ธ์ถœํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, ๋ชจ๋“  API ํ˜ธ์ถœ์ด ์ผ๊ด€๋œ ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ API ์—”๋“œํฌ์ธํŠธ(/auths/signup, /crews, /crewDetail ๋“ฑ)๊ฐ€ ์ƒ๋Œ€ ๊ฒฝ๋กœ๋กœ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ง€์ •๋˜์–ด ์žˆ์–ด base URL ์„ค์ • ์ œ๊ฑฐ๋Š” ์˜๋„๋œ ๋ณ€๊ฒฝ์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค.

๐Ÿ Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# API ํ˜ธ์ถœ ํŒจํ„ด ๊ฒ€์ƒ‰
rg "fetchApi\(" -A 2

Length of output: 22


Script:

#!/bin/bash
# API URL ํŒจํ„ด ๊ฒ€์ƒ‰
rg "fetch\(" -A 2

# URL ๋ฌธ์ž์—ด ํŒจํ„ด ๊ฒ€์ƒ‰
rg "const url = " -A 1

Length of output: 736


Script:

#!/bin/bash
# API URL ๊ด€๋ จ ์ฝ”๋“œ ๊ฒ€์ƒ‰
rg -B 3 -A 3 "const response = await fetch"

# API ๊ด€๋ จ ์„ค์ • ํŒŒ์ผ ๊ฒ€์ƒ‰
fd -e ts -e js -e json "config|env|constant" --exec cat {}

Length of output: 8314


Script:

#!/bin/bash
# API ๊ด€๋ จ ์„ค์ • ๋ฐ ๊ตฌํ˜„ ํŒŒ์ผ ๊ฒ€์ƒ‰
cat src/utils/api.ts

# fetchApi ํ•จ์ˆ˜ ์‚ฌ์šฉ ํŒจํ„ด ๊ฒ€์ƒ‰
rg "fetchApi<" -B 2 -A 2

Length of output: 4847

Comment on lines +18 to +26
return fetchApi<{ data: LoginResponse; headers: Headers }>('/auths/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then((response) => {
const token = response.headers.get('Authorization');
return { data: { token } };
Copy link

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion

์ฝ”๋“œ ์ค‘๋ณต์„ ์ œ๊ฑฐํ•˜๊ณ  ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ๋ฅผ ๊ฐœ์„ ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค

loginUser์™€ signupUser ํ•จ์ˆ˜๊ฐ€ ๋งค์šฐ ์œ ์‚ฌํ•œ ๋กœ์ง์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ ํ† ํฐ ์ถ”์ถœ ์‹œ ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ๊ฐ€ ๋ˆ„๋ฝ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฐœ์„ ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

  1. ํ† ํฐ ์ถ”์ถœ ๋กœ์ง์„ ๊ณตํ†ต ํ•จ์ˆ˜๋กœ ๋ถ„๋ฆฌ:
const extractAuthToken = (headers: Headers) => {
  const token = headers.get('Authorization');
  if (!token) {
    throw new Error('์ธ์ฆ ํ† ํฐ์ด ์—†์Šต๋‹ˆ๋‹ค');
  }
  return token;
};
  1. ๊ฐ ํ•จ์ˆ˜์—์„œ ๊ณตํ†ต ํ•จ์ˆ˜ ์‚ฌ์šฉ:
  }).then((response) => {
-   const token = response.headers.get('Authorization');
+   const token = extractAuthToken(response.headers);
    return { data: { token } };
  });

Comment on lines +5 to +13
return fetchApi<{ data: SignupResponse; headers: Headers }>('/auths/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then((response) => {
const token = response.headers.get('Authorization');
return { data: { token } };
Copy link

Choose a reason for hiding this comment

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

โš ๏ธ Potential issue

ํ† ํฐ ์ถ”์ถœ ์‹œ ์˜ค๋ฅ˜ ์ฒ˜๋ฆฌ ๋กœ์ง์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

ํ˜„์žฌ ๊ตฌํ˜„์—์„œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ž ์žฌ์ ์ธ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค:

  1. Authorization ํ—ค๋”๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค
  2. ์‘๋‹ต ๋ฐ์ดํ„ฐ์˜ ์œ ํšจ์„ฑ ๊ฒ€์ฆ์ด ์—†์Šต๋‹ˆ๋‹ค

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐœ์„ ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

  }).then((response) => {
    const token = response.headers.get('Authorization');
+   if (!token) {
+     throw new Error('์ธ์ฆ ํ† ํฐ์ด ์—†์Šต๋‹ˆ๋‹ค');
+   }
    return { data: { token } };
  });
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return fetchApi<{ data: SignupResponse; headers: Headers }>('/auths/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then((response) => {
const token = response.headers.get('Authorization');
return { data: { token } };
return fetchApi<{ data: SignupResponse; headers: Headers }>('/auths/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then((response) => {
const token = response.headers.get('Authorization');
if (!token) {
throw new Error('์ธ์ฆ ํ† ํฐ์ด ์—†์Šต๋‹ˆ๋‹ค');
}
return { data: { token } };

Comment on lines 22 to 28
if (error.status === 401) {
const { validationErrors } = error.detail;
Object.keys(validationErrors).forEach((key) => {
setError(key as 'email' | 'password', {
type: 'manual',
message: validationErrors[key],
});
Copy link

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion

์—๋Ÿฌ ์ฒ˜๋ฆฌ ๊ตฌํ˜„์— ๋Œ€ํ•œ ๊ฐœ์„  ์ œ์•ˆ

ํ˜„์žฌ ๊ตฌํ˜„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ž ์žฌ์ ์ธ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค:

  1. error.detail์ด ์กด์žฌํ•˜์ง€ ์•Š์„ ๊ฒฝ์šฐ ๋Ÿฐํƒ€์ž„ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
  2. validationErrors๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๊ฐ€ ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค
  3. ์˜ˆ์ƒ์น˜ ๋ชปํ•œ ํ•„๋“œ๋ช…์ด ๋“ค์–ด์˜ฌ ๊ฒฝ์šฐ ํƒ€์ž… ์•ˆ์ •์„ฑ์ด ๋ณด์žฅ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐœ์„ ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

  if (error.status === 401) {
-   const { validationErrors } = error.detail;
-   Object.keys(validationErrors).forEach((key) => {
-     setError(key as 'email' | 'password', {
-       type: 'manual',
-       message: validationErrors[key],
-     });
-   });
+   const validationErrors = error.detail?.validationErrors;
+   if (validationErrors) {
+     (Object.entries(validationErrors) as [keyof LoginFormValues, string][]).forEach(
+       ([field, message]) => {
+         setError(field, {
+           type: 'manual',
+           message,
+         });
+       }
+     );
+   } else {
+     setError('password', {
+       type: 'manual',
+       message: '๋กœ๊ทธ์ธ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.',
+     });
+   }
  }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (error.status === 401) {
const { validationErrors } = error.detail;
Object.keys(validationErrors).forEach((key) => {
setError(key as 'email' | 'password', {
type: 'manual',
message: validationErrors[key],
});
if (error.status === 401) {
const validationErrors = error.detail?.validationErrors;
if (validationErrors) {
(Object.entries(validationErrors) as [keyof LoginFormValues, string][]).forEach(
([field, message]) => {
setError(field, {
type: 'manual',
message,
});
}
);
} else {
setError('password', {
type: 'manual',
message: '๋กœ๊ทธ์ธ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.',
});
}
}

Comment on lines +24 to +31
if (error.status === 400) {
const { validationErrors } = error.detail;
Object.keys(validationErrors).forEach((key) => {
setError(key as 'email', {
type: 'manual',
message: validationErrors[key],
});
});
Copy link

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion

์—๋Ÿฌ ์ฒ˜๋ฆฌ ๋กœ์ง ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค

ํ˜„์žฌ ๊ตฌํ˜„๋œ ์—๋Ÿฌ ์ฒ˜๋ฆฌ์— ๋ช‡ ๊ฐ€์ง€ ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค:

  1. ํƒ€์ž… ์•ˆ์ „์„ฑ: key as 'email' ํƒ€์ž… ๋‹จ์–ธ์€ ์œ„ํ—˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
  2. ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์ฒ˜๋ฆฌ: ์„œ๋ฒ„ ์‘๋‹ต์ด ์˜ˆ์ƒ๊ณผ ๋‹ค๋ฅผ ๊ฒฝ์šฐ์˜ ์ฒ˜๋ฆฌ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค
  3. ์‚ฌ์šฉ์ž ํ”ผ๋“œ๋ฐฑ: ์ผ๋ฐ˜์ ์ธ ์„œ๋ฒ„ ์˜ค๋ฅ˜์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๊ฐ€ ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐœ์„ ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค:

 if (error.status === 400) {
   const { validationErrors } = error.detail;
-  Object.keys(validationErrors).forEach((key) => {
-    setError(key as 'email', {
-      type: 'manual',
-      message: validationErrors[key],
-    });
-  });
+  try {
+    Object.entries(validationErrors).forEach(([key, message]) => {
+      if (key in formMethods.getValues()) {
+        setError(key as keyof SignupFormValues, {
+          type: 'manual',
+          message: String(message),
+        });
+      }
+    });
+  } catch (e) {
+    console.error('์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ์ค‘ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค:', e);
+    setError('root', {
+      type: 'manual',
+      message: 'ํšŒ์›๊ฐ€์ž… ์ฒ˜๋ฆฌ ์ค‘ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.',
+    });
+  }
+} else {
+  setError('root', {
+    type: 'manual',
+    message: '์„œ๋ฒ„ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ์ž ์‹œ ํ›„ ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.',
+  });
 }
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (error.status === 400) {
const { validationErrors } = error.detail;
Object.keys(validationErrors).forEach((key) => {
setError(key as 'email', {
type: 'manual',
message: validationErrors[key],
});
});
if (error.status === 400) {
const { validationErrors } = error.detail;
try {
Object.entries(validationErrors).forEach(([key, message]) => {
if (key in formMethods.getValues()) {
setError(key as keyof SignupFormValues, {
type: 'manual',
message: String(message),
});
}
});
} catch (e) {
console.error('์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์—๋Ÿฌ ์ฒ˜๋ฆฌ ์ค‘ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค:', e);
setError('root', {
type: 'manual',
message: 'ํšŒ์›๊ฐ€์ž… ์ฒ˜๋ฆฌ ์ค‘ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.',
});
}
} else {
setError('root', {
type: 'manual',
message: '์„œ๋ฒ„ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ์ž ์‹œ ํ›„ ๋‹ค์‹œ ์‹œ๋„ํ•ด ์ฃผ์„ธ์š”.',
});
}

export function usePostLoginQuery() {
const queryClient = useQueryClient();
const { login } = useAuthStore();
const { login, setUser } = useAuthStore();
Copy link

Choose a reason for hiding this comment

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

๐Ÿ› ๏ธ Refactor suggestion

์ธ์ฆ ๋กœ์ง ์ค‘๋ณต ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋กœ๊ทธ์ธ๊ณผ ํšŒ์›๊ฐ€์ž…์—์„œ ๋™์ผํ•œ ํ† ํฐ ์ฒ˜๋ฆฌ ๋ฐ ์‚ฌ์šฉ์ž ์ƒํƒœ ๊ด€๋ฆฌ ๋กœ์ง์ด ๋ฐ˜๋ณต๋ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ณตํ†ต ๋กœ์ง์„ ๋ถ„๋ฆฌํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

// ๊ณตํ†ต ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜
async function handleAuthSuccess(
  response: { data: { token?: string } },
  queryClient: QueryClient,
  login: (token: string) => Promise<void>,
  setUser: (user: User) => void
) {
  const token = response.data.token?.replace(/^Bearer\s/, '');
  if (!token) {
    throw new Error('ํ† ํฐ์ด ์—†์Šต๋‹ˆ๋‹ค');
  }

  try {
    await login(token);
    const user: User = await queryClient.fetchQuery(getUserQuery());
    setUser(user);
  } catch (error) {
    console.error('์‚ฌ์šฉ์ž ์ƒํƒœ ์—…๋ฐ์ดํŠธ ์‹คํŒจ:', error);
    throw error;
  }
}

// ์‚ฌ์šฉ ์˜ˆ์‹œ
onSuccess: (response) => handleAuthSuccess(response, queryClient, login, setUser)

Also applies to: 31-35

@github-actions
Copy link

Copy link

@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: 1

๐Ÿงน Outside diff range and nitpick comments (1)
src/app/(auth)/layout.tsx (1)

33-33: ์ปจํ…์ธ  ์˜์—ญ์˜ ๋ฐ˜์‘ํ˜• ๋””์ž์ธ์ด ๊ฐœ์„ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๋„ˆ๋น„์™€ ์—ฌ๋ฐฑ ์กฐ์ •์ด ์ ์ ˆํ•˜๊ฒŒ ์ด๋ฃจ์–ด์กŒ์Šต๋‹ˆ๋‹ค. ๋‹ค๋งŒ, ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์„ ๋”์šฑ ํ–ฅ์ƒ์‹œํ‚ค๊ธฐ ์œ„ํ•ด ์ž‘์€ ํ™”๋ฉด์—์„œ์˜ ์—ฌ๋ฐฑ๋„ ๊ณ ๋ คํ•ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

-<div className="mt-6 w-full md:mt-12 md:w-2/3 lg:w-1/2">{children}</div>
+<div className="mx-auto mt-6 w-full max-w-md md:mt-12 md:w-2/3 lg:w-1/2">{children}</div>
๐Ÿ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between ad5a1db and ebe4eff.

๐Ÿ“’ Files selected for processing (1)
  • src/app/(auth)/layout.tsx (1 hunks)
๐Ÿ”‡ Additional comments (1)
src/app/(auth)/layout.tsx (1)

22-24: ์ด๋ฏธ์ง€ ์ปจํ…Œ์ด๋„ˆ์˜ ๋ฐ˜์‘ํ˜• ๋ ˆ์ด์•„์›ƒ์ด ๊ฐœ์„ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ค‘๊ฐ„ ํฌ๊ธฐ(md) ์ด์ƒ์˜ ํ™”๋ฉด์—์„œ ์ผ๊ด€๋œ 50% ๋„ˆ๋น„๋ฅผ ์œ ์ง€ํ•˜๋„๋ก ๋ณ€๊ฒฝ๋œ ๊ฒƒ์ด ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

<Image src={Auth} alt="auth" />
</div>
<div className="flex h-full w-full flex-col items-center bg-white p-6 md:w-1/2 md:justify-center md:p-8 lg:w-1/3 lg:p-20">
<div className="md:p-8lg:p-20 flex h-full w-full flex-col items-center bg-white p-6 md:w-1/2 md:justify-center">
Copy link

Choose a reason for hiding this comment

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

โš ๏ธ Potential issue

ํŒจ๋”ฉ ํด๋ž˜์Šค ๊ตฌ๋ฌธ ์˜ค๋ฅ˜๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

Tailwind CSS ํด๋ž˜์Šค ์‚ฌ์ด์— ๊ณต๋ฐฑ์ด ๋ˆ„๋ฝ๋˜์–ด ์žˆ์–ด ํฐ ํ™”๋ฉด์—์„œ ํŒจ๋”ฉ์ด ์ ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

-<div className="md:p-8lg:p-20 flex h-full w-full flex-col items-center bg-white p-6 md:w-1/2 md:justify-center">
+<div className="md:p-8 lg:p-20 flex h-full w-full flex-col items-center bg-white p-6 md:w-1/2 md:justify-center">
๐Ÿ“ Committable suggestion

โ€ผ๏ธ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="md:p-8lg:p-20 flex h-full w-full flex-col items-center bg-white p-6 md:w-1/2 md:justify-center">
<div className="md:p-8 lg:p-20 flex h-full w-full flex-col items-center bg-white p-6 md:w-1/2 md:justify-center">

@github-actions
Copy link

@github-actions
Copy link

Copy link

@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: 1

๐Ÿงน Outside diff range and nitpick comments (2)
.github/workflows/ci.yml (1)

80-81: ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •์ด ์ ์ ˆํžˆ ๊ตฌ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๋นŒ๋“œ ๋‹จ๊ณ„์—์„œ API ๊ธฐ๋ณธ URL์„ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋กœ ์„ค์ •ํ•œ ๊ฒƒ์€ ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค. GitHub Secrets๋ฅผ ํ†ตํ•ด ์•ˆ์ „ํ•˜๊ฒŒ ๊ด€๋ฆฌ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์›Œํฌํ”Œ๋กœ์šฐ ํŒŒ์ผ์— ํ™˜๊ฒฝ ๋ณ€์ˆ˜์˜ ์šฉ๋„์™€ ํ˜•์‹์— ๋Œ€ํ•œ ๊ฐ„๋‹จํ•œ ์ฃผ์„์„ ์ถ”๊ฐ€ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค:

 env:
+          # API ์—”๋“œํฌ์ธํŠธ์˜ ๊ธฐ๋ณธ URL (์˜ˆ: https://api.example.com)
           NEXT_PUBLIC_API_BASE_URL: ${{secrets.NEXT_PUBLIC_API_BASE_URL}}
src/components/common/header/header.stories.tsx (1)

Line range hint 25-30: ํ…Œ์ŠคํŠธ ๋ฐ์ดํ„ฐ ๊ด€๋ฆฌ ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

ํ…Œ์ŠคํŠธ ๋ฐ์ดํ„ฐ๊ฐ€ ์ปดํฌ๋„ŒํŠธ ๋‚ด๋ถ€์— ํ•˜๋“œ์ฝ”๋”ฉ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์œ ์ง€๋ณด์ˆ˜์„ฑ๊ณผ ์žฌ์‚ฌ์šฉ์„ฑ ์ธก๋ฉด์—์„œ ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ณ„๋„์˜ ํ…Œ์ŠคํŠธ ๋ฐ์ดํ„ฐ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜์—ฌ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

// src/__mocks__/auth-test-data.ts
export const TEST_AUTH_DATA = {
  token: 'test token',
  user: {
    id: 1,
    nickname: 'ํฌ๋ฃจํฌ๋ฃจ',
    email: 'john@example.com',
    profileImageUrl: 'https://image.file',
  },
};
๐Ÿ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between ebe4eff and 541da83.

๐Ÿ“’ Files selected for processing (5)
  • .github/workflows/ci.yml (1 hunks)
  • src/_queries/auth/auth-queries.tsx (2 hunks)
  • src/app/(auth)/layout.tsx (1 hunks)
  • src/app/(auth)/login/page.tsx (1 hunks)
  • src/components/common/header/header.stories.tsx (2 hunks)
๐Ÿšง Files skipped from review as they are similar to previous changes (3)
  • src/_queries/auth/auth-queries.tsx
  • src/app/(auth)/layout.tsx
  • src/app/(auth)/login/page.tsx

export default meta;
function Template() {
const { isAuth, login, logout } = useAuthStore();
const { isAuth, login, logout, setUser } = useAuthStore();
Copy link

Choose a reason for hiding this comment

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

โš ๏ธ Potential issue

์ธ์ฆ ๋กœ์ง ๊ฐœ์„ ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๋กœ๊ทธ์ธ ํ”„๋กœ์„ธ์Šค๊ฐ€ ๋‘ ๋‹จ๊ณ„๋กœ ๋ถ„๋ฆฌ๋˜์–ด ์žˆ์–ด ์ž ์žฌ์ ์ธ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. login๊ณผ setUser ํ˜ธ์ถœ ์‚ฌ์ด์— ๊ฒฝ์Ÿ ์ƒํƒœ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๋Š” ์‚ฌ์šฉ์ž ์ƒํƒœ๊ฐ€ ์ผ์‹œ์ ์œผ๋กœ ๋ถˆ์ผ์น˜ํ•˜๋Š” ์ƒํ™ฉ์„ ์ดˆ๋ž˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐœ์„ ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค:

-      login(testToken);
-      setUser(testUser);
+      await login(testToken);
+      await setUser(testUser);

๋˜๋Š” ๋” ๋‚˜์€ ๋ฐฉ๋ฒ•์œผ๋กœ, ์ธ์ฆ ๋กœ์ง์„ ํ•˜๋‚˜์˜ ํ•จ์ˆ˜๋กœ ํ†ตํ•ฉํ•˜๋Š” ๊ฒƒ์„ ๊ณ ๋ คํ•ด๋ณด์„ธ์š”:

-      login(testToken);
-      setUser(testUser);
+      await loginWithUser(testToken, testUser);

Also applies to: 37-38

Copy link
Contributor

@ChoYenii ChoYenii left a comment

Choose a reason for hiding this comment

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

์ˆ˜๊ณ  ๋งŽ์œผ์…จ์Šต๋‹ˆ๋‹ค!!

Copy link
Contributor

@yulrang yulrang left a comment

Choose a reason for hiding this comment

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

๋™์ž‘ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค~ ์ˆ˜๊ณ ํ•˜์…จ์–ด์š”!!
env api ์•ˆ๋ถ™์ด๋Š”๊ฑธ๋กœ ํ†ต์ผํ•ฉ์‹œ๋‹น~~

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.

๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž… API ์—ฐ๊ฒฐ

4 participants