Page Reloads in Next Auth
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
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
githubrepo:- https://github.com/drb1010/auth-demo
githubrepo:- https://github.com/drb1010/auth-demo
4 Replies
After changing the isLoggedIn state, the useEffect runs again because of the dependancy array.
Masai LionOP
still the problem exists after removing dependency from useEffect.Please help me.
username:admin@example.com
pwd:- 123
username:admin@example.com
pwd:- 123
Instead of using the state try to use the session itself to validate
Masai LionOP
i am validating in root component so i cant use useSession hook.can you give me some idea to achive this using getSession