Authentication verifies who a user is, while authorization controls what a user can access. Next.js supports multiple authentication patterns, each designed for different use cases.
Cookie-based authentication is a method of user authentication used in web applications. It relies on cookies to establish and maintain a user's authenticated session
- Authentication[ Done using Github ]
- Cookie-based authentication
npx create-next-app@latest
cd [ app name that is created ]
eg: npm install next-auth
npm install react-cookie
This was created to store the secreat key from github [ Or any other application eg: google ,facebook etc]
In this I have used Github key
[ Github -> login -> settings -> developer mode -> Oauth key -> new (then fill the inputs and generate a key]