feat(auth): implementar passkeys e gerenciamento em ajustes

This commit is contained in:
Felipe Coutinho
2026-03-02 01:33:05 +00:00
parent ff382a0ca7
commit 3d3a9e1414
13 changed files with 3164 additions and 7 deletions

View File

@@ -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")