Skip to content

Conversation

@sungwonnoh
Copy link
Contributor

  • 로그아웃 api연결
  • 401 에러 인터셉트 분기처리

@sungwonnoh sungwonnoh self-assigned this Oct 25, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @sungwonnoh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 사용자 인증 흐름의 안정성과 사용자 경험을 개선하기 위해 로그아웃 기능을 API와 연동하고, 401 인증 에러 처리 로직을 고도화합니다. 특히, 만료된 토큰을 자동으로 재발급하여 사용자 세션을 유지하고, 유효하지 않은 토큰에 대해서는 즉시 로그아웃 처리하여 보안을 강화하는 데 중점을 두었습니다.

Highlights

  • 로그아웃 API 연동: 설정 화면에서 로그아웃 버튼 클릭 시 authService를 통해 로그아웃 API를 호출하도록 구현했습니다.
  • 401 에러 인터셉터 개선: API 응답 중 401 에러 발생 시, 에러 코드(TOKEN_EXPIRED, TOKEN_BLACKLISTED 등)에 따라 토큰 재발급을 시도하거나 즉시 로그아웃 처리하는 분기 로직을 추가했습니다.
  • 토큰 재발급 로직 구현: TOKEN_EXPIRED 에러 발생 시 리프레시 토큰을 사용하여 액세스 토큰을 재발급하고, 동시에 여러 요청이 발생했을 때 이를 처리하기 위한 큐잉 메커니즘을 도입했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

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

Choose a reason for hiding this comment

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

Code Review

이번 PR은 로그아웃 API 연동과 Axios 인터셉터를 사용한 401 에러 처리 로직 개선에 중점을 두고 있습니다. 전반적으로 토큰 만료 시 재발급 및 요청 재시도 로직이 잘 구현되었습니다. 코드의 안정성과 유지보수성을 더욱 높이기 위해 타입 안정성 강화, API 엔드포인트 일관성, 그리고 에러 처리 강화에 대한 몇 가지 제안 사항을 리뷰에 남겼습니다.

return res;
},
async (error) => {
const originalRequest = error.config;

Choose a reason for hiding this comment

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

medium

error.config 객체에 _retry 속성을 동적으로 추가하고 있습니다. 이는 타입스크립트의 정적 타입 검사를 우회하는 방식으로, 코드의 가독성과 안정성을 저해할 수 있습니다. AxiosRequestConfig를 확장하는 별도의 인터페이스를 선언하여 _retry 속성을 명시적으로 정의하는 것이 좋습니다.

import { AxiosRequestConfig } from "axios";

interface RetryableAxiosRequestConfig extends AxiosRequestConfig {
  _retry?: boolean;
}

// ...

const originalRequest = error.config as RetryableAxiosRequestConfig;

이렇게 하면 _retry 속성의 존재와 타입을 명확히 할 수 있어 실수를 방지하고 코드 이해도를 높일 수 있습니다.

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