Authentication
Complete guide to authentication features and implementation.
The boilerplate uses Better Auth, the boiler-plate is pre-configured with the following
- Signup (Email / Password, Google, Discord, Github)
- Sign-in
- Forgot password
- Sign out
All authentication methods saves new users in the database when they sucessfully signup or signin. You have to configure the database first.
Providers
We'll use Google Provider for this but any other one follow the same process.
Follow these steps to configure Google OAuth for your application:
-
Go to the Google Cloud Console and create a new project
-
Go to "APIs & Services" or click here and then go to "Credentials"
-
Configure OAuth Consent Screen
-
Create OAuth 2.0 Client ID
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Select "Web application"
- Add authorized JavaScript origins:
- Add authorized redirect URIs:
- Click "Create"
-
Copy credentials to your
.env
file: