feat: add global_repositories query
This commit is contained in:
@@ -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()]
|
||||
});
|
||||
|
||||
@@ -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!,
|
||||
|
||||
@@ -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)],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user