Skip to content

Conversation

@kongnayeon
Copy link
Member

@kongnayeon kongnayeon commented May 28, 2025

관련 이슈

서버 에러 알림 모달을 제거합니다.

변경 사항

레퍼런스

Summary by CodeRabbit

  • 버그 수정
    • 구글 로그인 시 서버 점검 안내 모달이 더 이상 표시되지 않고, 바로 구글 인증 페이지로 이동하도록 개선되었습니다.

@kongnayeon kongnayeon self-assigned this May 28, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 28, 2025

Walkthrough

useModal 훅의 import와 사용이 제거되었으며, Google 로그인 시 서버 점검 안내 모달을 띄우던 부분이 삭제되었습니다. 이제 handleGoogleLogin 함수는 환경 변수의 Google 인증 URL로 직접 리디렉션만 수행합니다. 컴포넌트의 외부 인터페이스는 변경되지 않았습니다.

Changes

파일/경로 변경 요약
apps/web/src/app/join/Join.tsx useModal 훅 및 관련 모달 코드 삭제, Google 로그인 시 직접 리디렉션 처리로 변경

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant JoinPage
    participant GoogleAuthServer

    User->>JoinPage: "Google로 로그인" 버튼 클릭
    JoinPage->>JoinPage: handleGoogleLogin() 호출
    JoinPage->>GoogleAuthServer: window.location.href로 리디렉션
    GoogleAuthServer-->>User: 인증 페이지 표시
Loading

Possibly related PRs

Poem

🐇
로그인 문이 활짝 열렸네,
모달은 안녕, 바로 떠나네.
구글로 슝—직진만 남았지,
서버 점검 걱정은 이제 없지!
코드는 가볍게, 토끼는 신나게!

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.

apps/web/src/app/join/Join.tsx

Oops! Something went wrong! :(

ESLint: 9.17.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@repo/eslint-config' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:799:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:723:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:706:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:307:38)
at #link (node:internal/modules/esm/module_job:170:49)

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

@kongnayeon kongnayeon merged commit cfe416d into develop May 28, 2025
1 of 2 checks passed
@kongnayeon kongnayeon deleted the hotfix/rid-modal branch May 28, 2025 20:40
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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ba35e19 and 77082d3.

📒 Files selected for processing (1)
  • apps/web/src/app/join/Join.tsx (2 hunks)
🔇 Additional comments (1)
apps/web/src/app/join/Join.tsx (1)

8-8: useModal 훅 제거 승인

useModal 훅의 import가 제거되었고 컴포넌트 내에서 더 이상 사용되지 않는 것을 확인했습니다. 불필요한 의존성 제거로 코드가 깔끔해졌습니다.

Comment on lines 23 to 25
const handleGoogleLogin = async () => {
//window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
modal.alert({
title: '서버 점검 중',
description:
'5/30(금) 오전 1시에 완료될 예정이에요\n이용에 불편을 드려 죄송해요',
alertButton: '확인',
isCloseOnDimmerClick: false,
});
window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
};
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Google 로그인 함수 개선 필요

함수가 단순화되었지만 몇 가지 개선이 필요합니다:

  1. 환경 변수 검증: NEXT_PUBLIC_GOOGLE_AUTH_URL이 undefined일 때 빈 문자열로 리디렉션하면 예상치 못한 동작이 발생할 수 있습니다.
  2. async 키워드 불필요: 더 이상 비동기 작업을 수행하지 않으므로 async 키워드가 불필요합니다.

다음과 같이 개선하는 것을 권장합니다:

- const handleGoogleLogin = async () => {
-   window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
- };
+ const handleGoogleLogin = () => {
+   const googleAuthUrl = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL;
+   if (!googleAuthUrl) {
+     toast.error('로그인 서비스에 일시적인 문제가 발생했습니다.');
+     return;
+   }
+   window.location.href = googleAuthUrl;
+ };
📝 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
const handleGoogleLogin = async () => {
//window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
modal.alert({
title: '서버 점검 중',
description:
'5/30(금) 오전 1시에 완료될 예정이에요\n이용에 불편을 드려 죄송해요',
alertButton: '확인',
isCloseOnDimmerClick: false,
});
window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
};
const handleGoogleLogin = () => {
const googleAuthUrl = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL;
if (!googleAuthUrl) {
toast.error('로그인 서비스에 일시적인 문제가 발생했습니다.');
return;
}
window.location.href = googleAuthUrl;
};
🤖 Prompt for AI Agents
In apps/web/src/app/join/Join.tsx around lines 23 to 25, the handleGoogleLogin
function uses an async keyword unnecessarily and redirects to an empty string if
the environment variable NEXT_PUBLIC_GOOGLE_AUTH_URL is undefined, which can
cause unexpected behavior. Remove the async keyword since there are no
asynchronous operations, and add a check to ensure NEXT_PUBLIC_GOOGLE_AUTH_URL
is defined before setting window.location.href; if it is undefined, handle the
case appropriately, such as showing an error or avoiding redirection.

alertButton: '확인',
isCloseOnDimmerClick: false,
});
window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

환경 변수 설정 확인 요청

Google 인증 URL 환경 변수가 올바르게 설정되었는지 확인이 필요합니다. 환경 변수가 없을 경우 사용자에게 적절한 오류 메시지를 제공하는 것이 좋겠습니다.

다음 스크립트로 환경 변수 설정을 확인해주세요:


🏁 Script executed:

#!/bin/bash
# Description: 환경 변수 NEXT_PUBLIC_GOOGLE_AUTH_URL 설정 확인

# .env 파일들에서 NEXT_PUBLIC_GOOGLE_AUTH_URL 검색
fd -e env -x grep -l "NEXT_PUBLIC_GOOGLE_AUTH_URL" {} \;

# 환경 변수 사용처 검색
rg "NEXT_PUBLIC_GOOGLE_AUTH_URL" --type typescript --type javascript

Length of output: 163


다음 스크립트로 .env* 파일과 코드 전체에서 NEXT_PUBLIC_GOOGLE_AUTH_URL 설정 및 사용처를 다시 확인해주세요:


🏁 Script executed:

#!/bin/bash
# .env 파일(.env, .env.local 등)에서 NEXT_PUBLIC_GOOGLE_AUTH_URL 검색
rg --files-with-matches -g ".env*" "NEXT_PUBLIC_GOOGLE_AUTH_URL"

# 코드 전체에서 NEXT_PUBLIC_GOOGLE_AUTH_URL 사용처 검색 (ts, tsx, js, jsx)
rg "NEXT_PUBLIC_GOOGLE_AUTH_URL" -t ts -t tsx -t js -t jsx

Length of output: 300


.env 파일과 코드 전체를 숨김 파일 및 다양한 확장자까지 포함해 다시 검색해 보겠습니다:


🏁 Script executed:

#!/bin/bash
# 숨김 파일(.env*) 검색 포함
rg --hidden --files-with-matches --glob ".env*" "NEXT_PUBLIC_GOOGLE_AUTH_URL"

# 코드 전체 검색: ts, tsx, js, jsx 확장자 포함
rg --hidden --files-with-matches \
  --glob "*.ts" \
  --glob "*.tsx" \
  --glob "*.js" \
  --glob "*.jsx" \
  "NEXT_PUBLIC_GOOGLE_AUTH_URL"

Length of output: 378


❗ NEXT_PUBLIC_GOOGLE_AUTH_URL 환경 변수 정의 및 에러 처리 추가 요청

현재 apps/web/src/app/join/Join.tsx 에서만 process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL 을 참조하고 있으며, 레포지토리에 해당 키를 정의한 .env* 파일은 보이지 않습니다. 또한 환경 변수가 없을 때 빈 문자열로 바로 window.location.href 를 설정하고 있어 사용자 경험(UX)이 부정확해질 수 있습니다.

수정 제안:

  • .env, .env.local 등 설정 파일에 NEXT_PUBLIC_GOOGLE_AUTH_URL 이 정의되어 있는지 확인하고, 없다면 추가해주세요.
  • 환경 변수가 없을 때 사용자에게 알림 메시지를 표시하거나 로그인 버튼을 비활성화하는 등 명시적인 에러 처리를 구현해주세요.

예시 코드 스니펫:

- window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
+ const googleAuthUrl = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL;
+ if (!googleAuthUrl) {
+   // TODO: 사용자에게 오류 메시지 표시
+   console.error('환경 변수 NEXT_PUBLIC_GOOGLE_AUTH_URL이 설정되지 않았습니다.');
+   return;
+ }
+ window.location.href = googleAuthUrl;
  • 파일: apps/web/src/app/join/Join.tsx
  • 위치: 24행
📝 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
window.location.href = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL ?? '';
const googleAuthUrl = process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL;
if (!googleAuthUrl) {
// TODO: 사용자에게 오류 메시지 표시
console.error('환경 변수 NEXT_PUBLIC_GOOGLE_AUTH_URL이 설정되지 않았습니다.');
return;
}
window.location.href = googleAuthUrl;
🤖 Prompt for AI Agents
In apps/web/src/app/join/Join.tsx at line 24, the code sets window.location.href
to process.env.NEXT_PUBLIC_GOOGLE_AUTH_URL or an empty string without checking
if the environment variable is defined. To fix this, first ensure that
NEXT_PUBLIC_GOOGLE_AUTH_URL is properly defined in your .env or .env.local
files. Then, update the code to check if this environment variable exists before
redirecting; if it is missing, display an appropriate error message to the user
or disable the login button to prevent navigation to an invalid URL.

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.

2 participants