feat: add global_repositories query

This commit is contained in:
2026-01-20 16:17:53 -08:00
parent 43c9b7c238
commit 5eccfe32da
9 changed files with 481 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
import { jwtClient } from 'better-auth/client/plugins';
import { jwtClient, adminClient } from 'better-auth/client/plugins';
import { createAuthClient } from 'better-auth/svelte';
export const authClient = createAuthClient({
baseURL: 'http://localhost:5173',
plugins: [jwtClient()]
baseURL: 'http://localhost:5173',
plugins: [jwtClient(), adminClient()]
});

View File

@@ -2,14 +2,14 @@ import { betterAuth } from 'better-auth';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { db } from './db/drizzle';
import * as authSchema from './db/auth-schema';
import { jwt } from 'better-auth/plugins';
import { jwt, admin } from 'better-auth/plugins';
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: 'pg',
schema: { ...authSchema }
}),
plugins: [jwt()],
plugins: [jwt(), admin()],
socialProviders: {
github: {
clientId: process.env.GH_CLIENT_ID!,

View File

@@ -12,6 +12,10 @@ export const user = pgTable("user", {
.defaultNow()
.$onUpdate(() => /* @__PURE__ */ new Date())
.notNull(),
role: text("role"),
banned: boolean("banned").default(false),
banReason: text("ban_reason"),
banExpires: timestamp("ban_expires"),
});
export const session = pgTable(
@@ -29,6 +33,7 @@ export const session = pgTable(
userId: text("user_id")
.notNull()
.references(() => user.id, { onDelete: "cascade" }),
impersonatedBy: text("impersonated_by"),
},
(table) => [index("session_userId_idx").on(table.userId)],
);