feat: add OAuth support and email auth disable option for self-hosted instances #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR significantly enhances the authentication system for self-hosted Aptabase instances by adding comprehensive OAuth support and the ability to disable email-based authentication entirely.
What's New
OAuth Provider Support
Previously, self-hosted instances were limited to email-based authentication (magic links). This PR adds full OAuth support for:
Email Authentication Control
Added the ability to completely disable email-based authentication, making OAuth the only authentication method available. This is particularly useful for:
How It Works
Backend Changes
DISABLE_EMAIL_AUTH=true
/api/_auth/oauth-status
endpoint includes email auth statusFrontend Changes
Environment Variables Reference
DISABLE_EMAIL_AUTH
false
GitHub OAuth
OAUTH_GITHUB_CLIENT_ID
OAUTH_GITHUB_CLIENT_SECRET
Google OAuth
OAUTH_GOOGLE_CLIENT_ID
OAUTH_GOOGLE_CLIENT_SECRET
Authentik OAuth
OAUTH_AUTHENTIK_CLIENT_ID
OAUTH_AUTHENTIK_CLIENT_SECRET
OAUTH_AUTHENTIK_AUTHORIZE_URL
OAUTH_AUTHENTIK_TOKEN_URL
OAUTH_AUTHENTIK_USERINFO_URL
*Required only if you want to enable that specific OAuth provider
Usage Examples
Email + Github OAuth
Enterprise with Authentik only
Resolves #72