mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 09:01:19 +00:00
feat(backend): add admin plugin and create-admin script (#80)
* feat(backend): add admin plugin and create-admin script Add Better Auth admin plugin for role-based user management. Includes a CLI script to create admin accounts. Co-authored-by: Ona <no-reply@ona.com> * fix(backend): guard against missing BETTER_AUTH_SECRET Co-authored-by: Ona <no-reply@ona.com> --------- Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Run: bunx --bun auth@latest generate --config auth.ts --output src/db/auth-schema.ts
|
||||
import { betterAuth } from "better-auth"
|
||||
import { drizzleAdapter } from "better-auth/adapters/drizzle"
|
||||
import { admin } from "better-auth/plugins"
|
||||
import { SQL } from "bun"
|
||||
import { drizzle } from "drizzle-orm/bun-sql"
|
||||
|
||||
@@ -13,6 +14,7 @@ export const auth = betterAuth({
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
},
|
||||
plugins: [admin()],
|
||||
})
|
||||
|
||||
export default auth
|
||||
|
||||
Reference in New Issue
Block a user