Added passkey support

This commit is contained in:
2025-08-07 23:03:17 +02:00
parent 28e4f8467b
commit 0a4f5a7d36
17 changed files with 1133 additions and 86 deletions

View File

@@ -1,4 +1,4 @@
import { boolean, pgTable, text, timestamp } from "drizzle-orm/pg-core"
import { boolean, integer, pgTable, text, timestamp } from "drizzle-orm/pg-core"
export const user = pgTable("user", {
id: text("id").primaryKey(),
@@ -45,3 +45,17 @@ export const verification = pgTable("verification", {
createdAt: timestamp("created_at").$defaultFn(() => new Date()),
updatedAt: timestamp("updated_at").$defaultFn(() => new Date())
})
export const passkey = pgTable("passkey", {
id: text("id").primaryKey(),
name: text("name"),
publicKey: text("public_key").notNull(),
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
credentialID: text("credential_i_d").notNull(),
counter: integer("counter").notNull(),
deviceType: text("device_type").notNull(),
backedUp: boolean("backed_up").notNull(),
transports: text("transports"),
createdAt: timestamp("created_at"),
aaguid: text("aaguid")
})