Bug Report: “Signed in!” Toast Reappears When Switching Tabs
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
- Log in to the application successfully.
- Observe the “Sign-In Successful” toast appearing once (✅ expected).
- Open a new browser tab or switch to another tab.
- Return to the original tab.
- 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:
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
@smokeyScraper sir please assign this issue to me
Seems reasonable to me. Assigned @Vaibhaviitian
Most applications store login success state in localStorage, sessionStorage, or rely on an auth state listener that runs on page load. if (localStorage.getItem("loggedIn") === "true") { toast("Sign-In Successful"); } browser re runs this logic again and again when user switch the tab. Solution Approach
Store a flag like "hasShownLoginToast" in either:
React State (ideal)
Session Storage (OK)
In-memory flag (OK but resets on reload)
and reset it only when logging out, not when switching tabs. please can u assign this issue to me i want to worko n this..
@bhavyaagarwal25 i was busy with my end sem and i am working on this
Seems reasonable to me. Assigned @Vaibhaviitian
sir i resolved the issue kindly check pr once @smokeyScraper
sir plz assign this bug
Hi @smokeyScraper , As i can see this issue is still open, i believe that i can fix this bug. So I’d like to work on this issue.
I’ve already contributed to this repository earlier, and I’ve gone through the auth and toast handling logic related to this bug.
My plan is to ensure the “Sign-In Successful” toast is triggered only on a fresh login event, and not during auth state rehydration or when switching browser tabs.
Please assign this issue to me. Thanks!!
Hi @smokeyScraper,
I can reproduce this issue locally. I’ll work on ensuring the success toast only fires on a real login event and not when switching or reopening tabs. Will open a PR soon.
Thanks!