-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Root Cause Analysis
Error
The redirect_uri is not associated with this application.
Root Cause
The GitHub OAuth App configuration is missing the required redirect URI.
Current Redirect URI (not configured):
https://www.tinte.dev/api/auth/callback/github
Technical Context
- App uses Better Auth with GitHub social provider
- Better Auth automatically handles OAuth callbacks at
/api/auth/callback/{provider}
- GitHub OAuth requires all redirect URIs to be pre-registered in the app settings
Solution
Add the redirect URI to GitHub OAuth App settings:
- Go to: https://github.com/settings/developers
- Select OAuth App with client ID:
Ov23li084KGytACj3Oe2
- Add to "Authorization callback URL":
https://www.tinte.dev/api/auth/callback/github
For Local Development
Also add:
http://localhost:3000/api/auth/callback/github
Files Involved
src/lib/auth.ts
- GitHub OAuth configurationsrc/app/api/auth/[...all]/route.ts
- Better Auth handler (manages callback route)
Prevention
When deploying to new domains (staging, preview, etc.), ensure redirect URIs are added to GitHub OAuth App settings before testing authentication.
Metadata
Metadata
Assignees
Labels
No labels