feat(auth): implementar passkeys e gerenciamento em ajustes
This commit is contained in:
21
db/schema.ts
21
db/schema.ts
@@ -100,6 +100,27 @@ export const verification = pgTable("verification", {
|
||||
}),
|
||||
});
|
||||
|
||||
// ===================== PASSKEY (WebAuthn) =====================
|
||||
|
||||
export const passkey = pgTable("passkey", {
|
||||
id: text("id").primaryKey(),
|
||||
name: text("name"),
|
||||
publicKey: text("publicKey").notNull(),
|
||||
userId: text("userId")
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
credentialID: text("credentialID").notNull(),
|
||||
counter: integer("counter").notNull(),
|
||||
deviceType: text("deviceType").notNull(),
|
||||
backedUp: boolean("backedUp").notNull(),
|
||||
transports: text("transports"),
|
||||
aaguid: text("aaguid"),
|
||||
createdAt: timestamp("createdAt", {
|
||||
mode: "date",
|
||||
withTimezone: true,
|
||||
}),
|
||||
});
|
||||
|
||||
export const preferenciasUsuario = pgTable("preferencias_usuario", {
|
||||
id: uuid("id").primaryKey().default(sql`gen_random_uuid()`),
|
||||
userId: text("user_id")
|
||||
|
||||
Reference in New Issue
Block a user