Next.js Discord

Discord Forum

Cant redirect with login to protected page

Unanswered
Iischeese posted this in #help-forum
Open in Discord
I'm trying to create a application that has a login page powered by Supabase. However when I attempt to redirect after calling the login function it does nothing. (I also added the revalidate path tag).
The only solution I've found is to wrap both in a setTimout; Suggesting that the process of loging in has not had enough time to process. The only problem with this is that next redirect throws an error, which is fine outside of the timeout but not inside (as it crashes). Any Ideas? Thanks in advance.

This is my repository: https://github.com/Iischeese/classroom/

0 Replies