feat: add auth to tui

This commit is contained in:
Max Koon
2025-11-17 10:08:10 -05:00
parent 114eaf88eb
commit 9e11455db1
17 changed files with 388 additions and 16 deletions

View File

@@ -5,6 +5,7 @@ import {
text,
timestamp,
uniqueIndex,
integer,
} from "drizzle-orm/pg-core";
import { users } from "./public";
@@ -93,3 +94,19 @@ export const auditLogs = pgTable("audit_log", {
action: text("action").notNull(),
});
export const deviceCodes = pgTable("deviceCode", {
id: text("id").primaryKey(),
deviceCode: text("device_code").notNull(),
userCode: text("user_code").notNull(),
userId: text("user_id").references(() => users.id, {
onDelete: "set null",
}),
clientId: text("client_id"),
scope: text("scope"),
status: text("status").notNull(),
expiresAt: timestamp("expires_at"),
lastPolledAt: timestamp("last_polled_at"),
pollingInterval: integer("polling_interval"),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at").notNull().defaultNow(),
});