supastarter for Next.jsAuthentication
oAuth
Learn how to setup up new oAuth provider in your supastarter application.
Setup up new provider
As an example, we will add Facebook as an oAuth provider.
First go to the Facebook developer console and create a new app.
Add the credentials to your .env.local
file:
In the /packages/auth/auth.ts
file you need to add the new provider add the new provider to the following places:
The last thing you need to do is to add the new provider to the oAuthProviders
object in the apps/web/modules/saas/auth/constants/oauth-providers.ts
file:
Now you should see the new provider on the login page.
Learn more about oAuth providers in the better-auth documentation.