BUG: Silent 401 handling does not redirect user to login

オープン
#285 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@mahek2016 がすでに取り組んでいます。

2026年2月21日 から。

  • #286 @mahek2016 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
supabase

調査の方向性

Issue に記載された Axios のレスポンスインターセプターから開始し、認証/セッション状態がどのように保存され、/login へのナビゲーションがどのように実行されるかを追跡します。期限切れトークンを使ったリクエストを再現し、その後、決定的な 401 によって Supabase signOut または同等の処理を通じてセッションが消去され、/login にリダイレクトされるか、セッションの期限切れを明確に示すフィードバックが表示されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Is there an existing issue for this?
  • I have searched the existing issues
What happened?

📌 Issue Overview

When an API request returns a 401 Unauthorized response, the frontend only logs an error in the console and does not provide any visible feedback or redirect to the login page.


🔍 Current Behavior

  • Axios interceptor catches 401
  • Console logs "Unauthorized request"
  • User remains on the same page
  • UI appears broken (data not loading, buttons failing)
  • No redirection or session reset occurs

✅ Expected Behavior

  • On a definitive 401 response:
    • Clear authentication/session state
    • Redirect user to /login
    • OR display a clear “Session expired” message

🧪 Steps to Reproduce

  1. Login normally
  2. Expire the token manually or clear auth storage
  3. Trigger any protected API call (dashboard, analytics, etc.)
  4. Observe that console logs error but no redirect or UI feedback occurs

🎯 Impact

This affects production readiness and user experience.

When sessions expire:

  • Users experience broken UI behavior
  • No guidance is provided
  • App appears unstable

💡 Suggested Direction

In the Axios response interceptor:

  • Trigger a global logout (Supabase signOut or equivalent)
  • Redirect to /login
  • Optionally show a “Session expired” notification
Record
  • I agree to follow this project's Code of Conduct
  • I want to work on this issue
主要言語
Python
スター
103
フォーク
143
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/Devr.AI のほかの issue

AOSSIE-Org/Devr.AI の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。