This example creates a basic CRUD app using next-connect and cookie-based authentication with Passport.js. The cookie is securely encrypted using @hapi/iron.
The example shows how to do a sign up, login, logout, and account deactivation. It utilizes React Query to fetch the API.
For demo purpose, the users database is stored in the cookie session. You need to replace it with an actual database to store users in db.js.
After running npm install
or yarn
to install dependencies, you can start the dev server:
yarn dev
# or
npm run dev
Click "Login" in the navbar to visit the login page where you can login or create an account if you don't have one. Once logged in, you can visit your profile by clicking "Profile" in the navbar to edit your user details or deactivate your account.