This is a full stack Airbnb clone.
The NextAuth handler route is located in the "pages" folder for convenience and simplicity. Although it is possible to initialize NextAuth in a route handler such as an API router (e.g., App Router), the recommended approach for advanced initialization is to use the page router.
To learn more about the route handler initialization in NextAuth, you can refer to the NextAuth documentation on Route Handlers. Additionally, for advanced initialization techniques, you can explore the documentation section on Advanced Initialization.
npm i --save @next-auth/prisma-adapter @prisma/client next-auth
npm i --save-dev prisma
-
Navigate to the GitHub Developers settings page.
-
Click on the
New OAuth App
button. -
Fill in the required information:
- Application name: Choose a name for your application.
Homepage URL
:http://localhost:3000
.Authorization Callback URL
:http://localhost:3000/api/auth/callback/google
.- Click on
Register application
to create your Discord OAuth app.
-
Once the app is created, you will see the
Client ID
andClient Secret
under the app's settings. These are your Discord OAuth Client and Secret Access Keys, respectively.
-
Navigate to the Google Cloud Console Credentials page.
-
Click on
Create credentials
and selectOAuth Client ID
. -
Choose
Web application
as the application type. -
Fill in the required information:
- Name: Choose a name for your application.
Authorized JavaScript origins
:http://localhost:3000
.Authorized redirect URIs
:http://localhost:3000/api/auth.callback/google
.- Click on
Create
to generate your Google OAuth Client and Secret Access Keys.
-
Once created, you will see the
Client ID
andClient Secret
on the credentials page. These are your Google OAuth Client and Secret Access Keys, respectively.