Merge branch 'dev' into user-management-and-resources

This commit is contained in:
Adrian Astles 2025-07-15 05:51:47 +08:00 committed by GitHub
commit 5278c4d6f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 2109 additions and 76 deletions

View file

@ -139,6 +139,29 @@ export const users = sqliteTable("user", {
.default(false)
});
export const securityKeys = sqliteTable("webauthnCredentials", {
credentialId: text("credentialId").primaryKey(),
userId: text("userId").notNull().references(() => users.userId, {
onDelete: "cascade"
}),
publicKey: text("publicKey").notNull(),
signCount: integer("signCount").notNull(),
transports: text("transports"),
name: text("name"),
lastUsed: text("lastUsed").notNull(),
dateCreated: text("dateCreated").notNull()
});
export const webauthnChallenge = sqliteTable("webauthnChallenge", {
sessionId: text("sessionId").primaryKey(),
challenge: text("challenge").notNull(),
securityKeyName: text("securityKeyName"),
userId: text("userId").references(() => users.userId, {
onDelete: "cascade"
}),
expiresAt: integer("expiresAt").notNull() // Unix timestamp
});
export const newts = sqliteTable("newt", {
newtId: text("id").primaryKey(),
secretHash: text("secretHash").notNull(),