Learn Auth Redirect Next.js
If we open a page and it is not logged in, it will show a full page loader, then when it is fully rendered, useEffect will run and push to home page.
The blocked-unhandled will show the case when not using full page loader, and it will flash the content
Check out this blog post for explanation{ "isAuthenticated": false }
{ "error": "you are logged out, and there is no user object, and no token" }
Setting up token, if you add token, then you are considered logged in even in a new tab
List of page (using Next.js Link), will authorized if login (token & no token):
go to /unprotected page (everyone can access even if not logged in)go to /blocked-unhandled page (will flash content, try opening a new tab to see more clearly)go to /blocked page (won't show content if not authorized)go to /blocked-component page
Try to directly go to (will open a new tab), will only authorized if using token: