Skip to content

Feat/betterauth dash#5

Merged
zigapk merged 4 commits intomasterfrom
feat/betterauth-dash
Mar 16, 2026
Merged

Feat/betterauth dash#5
zigapk merged 4 commits intomasterfrom
feat/betterauth-dash

Conversation

@zigapk
Copy link
Copy Markdown
Member

@zigapk zigapk commented Mar 16, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the application's authentication and user management capabilities by upgrading the better-auth library and integrating its new dashboard and admin features. It introduces new database fields to support advanced user states like roles and banning, and enables activity tracking for better oversight, laying the groundwork for a more robust administrative interface.

Highlights

  • Dependency Updates: Updated better-auth and its core dependencies to version 1.5.5, introducing new adapter packages and several new related dependencies for enhanced functionality.
  • Database Schema Enhancements: Implemented database schema changes to support advanced user management features, including roles, banning, and last active tracking for users, and impersonation tracking for sessions.
  • Admin Dashboard Integration: Integrated the @better-auth/infra dash plugin, enabling an admin dashboard and activity tracking within the authentication system.
  • Configuration Update: Added a new required environment variable, BETTER_AUTH_API_KEY, for configuring the dash plugin.
Changelog
  • bun.lock
    • Updated various better-auth related dependencies and added new ones, reflecting the upgrade and new plugin integrations.
  • docker-compose.dev.yml
    • Added a user configuration to the postgres service for improved container permissions.
  • env.ts
    • Introduced BETTER_AUTH_API_KEY as a new required environment variable.
  • package.json
    • Updated better-auth and added new @better-auth packages and other related dependencies.
  • server/database/migrations/0002_shocking_proteus.sql
    • Created a new migration script to add impersonated_by to the session table and role, banned, ban_reason, ban_expires, last_active_at to the user table.
  • server/database/migrations/meta/0002_snapshot.json
    • Generated a new Drizzle snapshot reflecting the updated database schema.
  • server/database/migrations/meta/_journal.json
    • Updated the migration journal to include the new schema migration.
  • server/database/schema/auth.ts
    • Modified the user and session schemas to include new fields for roles, banning, last activity, and impersonation.
  • server/lib/auth.ts
    • Configured betterAuth to use the new admin and dash plugins, enabling the admin dashboard and activity tracking with the new API key.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Activity
  • No specific activity (comments, reviews, progress) was provided for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@zigapk zigapk merged commit 3b765b7 into master Mar 16, 2026
5 checks passed
@zigapk zigapk deleted the feat/betterauth-dash branch March 16, 2026 14:21
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request primarily focuses on upgrading the better-auth dependency and integrating its new dashboard and admin features. The changes include updating package dependencies, adding a new environment variable for the Better Auth API key, and applying database schema migrations to support new functionalities like user roles, banning, and session impersonation. The new dash and admin plugins are correctly configured in the authentication setup. My review includes one suggestion to improve maintainability by making a configuration value environment-specific, rather than hardcoding it.

dash({
apiKey: env.BETTER_AUTH_API_KEY,
activityTracking: {
enabled: true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The activityTracking.enabled flag is hardcoded. To allow for more flexibility across different environments, it's better to control this via an environment variable. This would allow you to easily enable or disable activity tracking without changing the code.

To implement this, you'll need to add a new variable to your environment schema in env.ts, for example:

// in env.ts
// ...
    BETTER_AUTH_DASH_ACTIVITY_TRACKING_ENABLED: z.coerce.boolean().default(true),
// ...
Suggested change
enabled: true,
enabled: env.BETTER_AUTH_DASH_ACTIVITY_TRACKING_ENABLED,
References
  1. Configuration values like cache maxAge should be configurable via environment variables rather than being hardcoded.

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.

1 participant