with-passport

на сайте с March 23, 2023 17:41
This example show how to use Passport.js with Next.js. The example features cookie based authentication with username and password. The example shows how to do a login, signup and logout; and to get the user info using a hook with SWR. A database is not included. You can use any database you want and add it in this file. The login cookie is httpOnly, meaning it can only be accessed by the API, and it's encrypted using @hapi/iron for more security.