+
Skip to content

GitHub OAuth Error #55

@camilocbarrera

Description

@camilocbarrera
Image

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:

  1. Go to: https://github.com/settings/developers
  2. Select OAuth App with client ID: Ov23li084KGytACj3Oe2
  3. 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 configuration
  • src/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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载