Leave Localhost logoLeave LocalhostDocs
Authentication

Removing Authentication Providers

You might decide to simplify your login experience by removing unused authentication providers. Since Better Auth is configured declaratively, removing a provider is straightforward.

You might decide to simplify your login experience by removing unused authentication providers. Since Better Auth is configured declaratively, removing a provider is straightforward.

Removing Social Providers

To remove a social provider like Google or Microsoft:

  1. Open packages/backend/convex/auth.ts.
  2. Locate the socialProviders configuration inside the createAuth function.
  3. Remove the corresponding block (e.g., the google object or the ...microsoftSocialProvider spread).
  4. Remove the associated environment variables from your .env file to clean up your configuration.

Removing Email & Password

To enforce a completely passwordless experience, you can disable email and password authentication:

  1. Open packages/backend/convex/auth.ts.
  2. Locate the emailAndPassword configuration.
  3. Change enabled: true to enabled: false.
emailAndPassword: {
  enabled: false,
},

Considerations

  • Existing Users: Before removing a provider, consider how existing users who rely on that provider will access their accounts. You may need to ask them to link another auth method before disabling it.
  • UI Updates: Ensure you update your frontend authentication components in packages/ui and apps/app to remove the buttons or forms associated with the disabled provider.

On this page