AOSSIE-Org / AOSSIE-Org/Devr.AI

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

Aberta
#171 8 comentários 0 reações 1 responsável Reivindicada por @DecodeX15 Ver no GitHub
bug good first issue
Linguagem predominante
Python
Estrelas
102
Forks
137
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.