Page Reloads in Next Auth
Open in Discord
Masai Lion posted this in #help-forum
I am using next auth for authentication. When login is successful it redirects to another page. But before redirecting the login page reloads and then only it redirects to another page.How to stop this reloading behaviours.#nextauth
After changing the isLoggedIn state, the useEffect runs again because of the dependancy array.
still the problem exists after removing dependency from useEffect.Please help me.
Instead of using the state try to use the session itself to validate
i am validating in root component so i cant use useSession hook.can you give me some idea to achive this using getSession