AOSSIE-Org / AOSSIE-Org/Devr.AI

Bug Report: “Signed in!” Toast Reappears When Switching Tabs

Aperta
#171 8 commenti 0 reazioni 1 assegnatario Rivendicata da @DecodeX15 Vedi su GitHub
bug good first issue
Lingua principale
Python
Stelle
102
Fork
137
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.