AOSSIE-Org / AOSSIE-Org/Devr.AI
Bug Report: “Signed in!” Toast Reappears When Switching Tabs
- 主要語言
- Python
- 星號
- 102
- 分支
- 137
- PR 合併指標
- 30 天內沒有已合併 PR
描述
### Is there an existing issue for this?
- [x] I have searched the existing issues
### What happened?
## 🐞 Bug Report: “Sign-In Successful” Toast Reappears When Switching Tabs
### 📌 Issue Overview
After logging in, the user correctly sees the “Sign-In Successful” toast once.
However, when switching between browser tabs or reopening the same tab, the toast message reappears multiple times — even though the user session is already active.
This does **not** happen when navigating within the website using internal routes.
The issue only occurs when switching or reopening browser tabs.
---
### 🔍 Steps to Reproduce
1. Log in to the application successfully.
2. Observe the “Sign-In Successful” toast appearing once (✅ expected).
3. Open a new browser tab or switch to another tab.
4. Return to the original tab.
5. The same “Sign-In Successful” toast appears again repeatedly.
---
### 🎯 Expected Behavior
The “Sign-In Successful” toast should appear **only once**, immediately after successful login —
and **should not reappear** when switching or reopening browser tabs.
---
### 🚨 Actual Behavior
The toast notification reappears every time the user switches back to the tab,
causing confusion and unnecessary repetition for authenticated users.
---
### 💡 Suggested Improvements
- Before showing the success toast, check if the user is already authenticated (via cookies, localStorage, or session state).
- Only trigger the toast when a **new** sign-in event occurs, not when the page gains focus again.
Example logic:
```js
if (!toastShown && isAuthenticated) {
showToast("Sign-In Successful");
setToastShown(true);
}
### 🖼️ Screenshot / Screen Recording
https://github.com/user-attachments/assets/a63fccc2-8034-4b94-af1d-bdd183e17a05
### Record
- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。