next.js authorization example including private route protection. WARNING - This is probably not a great reference in 2023 and beyond, consider using next-auth.
!! WARNING - This is probably not a great reference in 2023 and beyond. ! This example uses a version of Next.js from 2021. A great ! auth library for next-js is https://next-auth.js.org/ !
Next.js authorization example including private route protection
git clone [email protected]:jasonraimondi/nextjs-jwt-example.git
cd nextjs-jwt-example
go run ./api/main.go
____ __
/ __/___/ / ___
/ _// __/ _ \/ _ \
/___/\__/_//_/\___/ v3.3.10-dev
High performance, minimalist Go web framework
https://echo.labstack.com
____________________________________O/_______
O\
⇨ http server started on [::]:1323
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.