Skip to content

feat(auth): Better Auth admin plugin, Google & GitHub OAuth, Account Linking, and Header Profile Dropdown - #1

Merged
samthelightbender merged 22 commits into
mainfrom
auth
Aug 30, 2026
Merged

samthelightbender merged 22 commits into
mainfrom
auth

Conversation

@samthelightbender

Copy link
Copy Markdown
Owner

Summary of Changes

  • Better Auth Admin Plugin: Enabled \�dmin()\ plugin with uppercase \defaultRole: 'USER'\ and \�dminRoles: ['MODERATOR', 'ADMIN']. Updated Prisma \User\ schema with \�anned, \�anReason, and \�anExpires.
  • Database Seeding: Updated \prisma/seeds/user.ts\ to use \�uth.api.createUser.
  • OAuth (Google & GitHub): Added Google & GitHub OAuth sign-up/login buttons on both Login and Register pages.
  • Account Linking: Configured account linking in Better Auth (\�ccountLinking.enabled = true) to prevent duplicate account creation when signing in with the same email across different providers.
  • Header Navbar: Updated landing page Header to dynamically handle authenticated user session, displaying a profile dropdown (Feeds & Keluar) and user avatar.

samthelightbender and others added 22 commits September 25, 2025 01:25
Changed the Prisma schema path in all related npm scripts from 'src/prisma/schema.prisma' to 'prisma/schema.prisma' to reflect the new schema location.
Centralizes the Prisma schema path within `prisma.config.ts`, enabling the removal of redundant `--schema` arguments from database-related npm scripts.

Integrates `prisma format` into the `lint` and `lint:fix` commands to ensure consistent code formatting.

Removes the unused `eslint-plugin-naming` dependency and cleans up an unused `lucide-react` import and unutilized `ctx` parameters in authentication callbacks.
Temporarily comments out models and fields unrelated to core authentication. This includes `Post`, `Like`, `Comment`, `Report`, `Follow`, and `LeaderboardSnapshot` models, along with their associated relations in the `User` model.

This change streamlines the database schema to focus solely on the initial authentication functionality, enabling a clearer development path. These features will be uncommented and implemented as they are developed.

Also renames the base migration file to accurately reflect its purpose in setting up the initial authentication tables.
This commit adds support for authenticating with Google and GitHub in addition to the existing authentication mechanism. This enhancement allows users to login using their social media accounts, providing a more convenient and secure experience. The changes include adding new environment variables and registering the authentication routes.
Enhances the accessibility and readability of the login form by providing clear labels and links for users.
Updates the layout to direct users to the correct authentication routes.
Adds social login buttons for GitHub.
Updates the CTAs on the landing page and header to direct users to the login/auth/register pages.
Improves overall user navigation and reduces confusion.
@samthelightbender
samthelightbender merged commit 6a60063 into main Aug 30, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants