Skip to content

amolj2003/twayam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authentication :

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.

Cookies Based Authentication :

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

Summary of Things that are Done in this Next js website :

  1. Authentication[ Done using Github ]
  2. Cookie-based authentication

Steps 1:

Created a Next Application

npx create-next-app@latest
cd [ app name that is created ]

Step 2 :

Installed Dependencies

eg: npm install next-auth
    npm install react-cookie

STEP 3 :

Created .env.local directory

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]

Screenshot 2023-08-26 185338

step 4 :

Made Login page

Login and Signup First Time to github ( Next Time This will be Done by Cookies) :

Screenshot 2023-08-26 234103

Step 5 :

Made Authentication Over Cookies

Login Before Authentication:


Screenshot 2023-08-26 234150

Logged In


Screenshot 2023-08-26 234125

Step 6:

Console Image Of Successfull Authentication


Screenshot 2023-08-27 010142

Console Image Of Cookies Generated :

Before Logged IN (No cookies Present )


Screenshot 2023-08-27 010009

After Logged In (Cookies Present)


Screenshot 2023-08-27 010053

All Sessions and Pages are Running at 200 (successfully) :


Screenshot 2023-08-27 005937

Faced a little Problem to Work on the Deployment Part

The Authentication Is similarly used in the yarn and Next js Part of Tamagui


Screenshot 2023-08-27 141529


Screenshot 2023-08-27 141632