Skip to content

feat: add GitHub OAuth authentication with Turso - #42

Merged
arnabnandy7 merged 1 commit into
mainfrom
feature/githubOAuthLogin
Aug 20, 2026
Merged

feat: add GitHub OAuth authentication with Turso#42
arnabnandy7 merged 1 commit into
mainfrom
feature/githubOAuthLogin

Conversation

@arnabnandy7

Copy link
Copy Markdown
Owner

Summary

Adds GitHub OAuth authentication using Better Auth, with users, linked accounts, and sessions persisted in Turso.

Changes

  • Add Better Auth with GitHub as the OAuth provider
  • Add Drizzle ORM and the Turso/libSQL database client
  • Add the /api/auth/[...all] authentication route
  • Add sign-in, account display, and sign-out controls
  • Display authenticated users’ GitHub names and avatars
  • Configure GitHub avatar images in Next.js
  • Add Better Auth database schemas for:
    • Users
    • OAuth accounts
    • Sessions
    • Verification records
  • Add a reproducible Turso migration
  • Document the required environment variables in .env.example

Environment Variables

The following variables must be configured in Vercel:

  • TURSO_DATABASE_URL
  • TURSO_AUTH_TOKEN
  • BETTER_AUTH_SECRET
  • BETTER_AUTH_URL
  • GITHUB_CLIENT_ID
  • GITHUB_CLIENT_SECRET

For production:

BETTER_AUTH_URL=https://openissue-dev.vercel.app

GitHub OAuth callback URL:

https://openissue-dev.vercel.app/api/auth/callback/github

Database

The migration creates the following tables:

  • user
  • account
  • session
  • verification

The migration has already been applied to the current Turso database.

Validation

  • TypeScript validation passed
  • Authentication files passed ESLint
  • 38 existing tests passed
  • Production build passed
  • Turso connection verified
  • Remote authentication tables verified
  • No credentials or secrets are included in tracked files

Testing Instructions

  1. Configure the required environment variables.
  2. Start the application.
  3. Click Sign in with GitHub.
  4. Authorize the OAuth application.
  5. Confirm that the application returns to the homepage.
  6. Confirm that the user’s GitHub name and avatar are displayed.
  7. Confirm that user, account, and session records are created in Turso.
  8. Click the sign-out button and confirm the session ends.

Closes #41

@arnabnandy7 arnabnandy7 added this to the 0.1.0 milestone Aug 20, 2026
@arnabnandy7 arnabnandy7 self-assigned this Aug 20, 2026
@arnabnandy7 arnabnandy7 added the enhancement New feature or request label Aug 20, 2026
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openissue-dev Ready Ready Preview Aug 20, 2026 2:15pm

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@sonarqubecloud

Copy link
Copy Markdown

@arnabnandy7
arnabnandy7 merged commit 6334e6b into main Aug 20, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Completed in Open issue portal development Aug 20, 2026
@arnabnandy7 arnabnandy7 mentioned this pull request Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

Add GitHub OAuth authentication with Turso persistence

1 participant