next.js authorization example including private route protection. WARNING - This is probably not a great reference in 2023 and beyond, consider using next-auth.
Seems like first time login, /dashboard page will display isAuthenticated:YES, but will display isAuthenticated:NO if clicking other page and then click /dashboard.
Hi author,
I can't find method fromNext() in AuthToken class const auth = AuthToken.fromNext(ctx);
this line in privateRouter function,
please help me to clear this issue.
Thank you in advance.