feat(auth): добавить вход по passkey
quality / commitlint (push) Skipped
quality / changes (push) Successful in 8s
quality / docker-check (push) Skipped
quality / web (push) Successful in 1m11s
quality / api (push) Successful in 47s
CD / quality (push) Successful in 2m10s
CD / publish (push) Successful in 1m50s

Альтернатива паролю на портале; SSO приложений без изменений.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-08-19 10:24:46 +07:00
co-authored by Cursor
parent f76b89c1df
commit 46dc2f714c
26 changed files with 1820 additions and 72 deletions
+31
View File
@@ -400,11 +400,42 @@ export const adminUserSchema = z.object({
permissions: z.array(z.string()),
last_login_at: z.string().nullable(),
last_login_ip: z.string().nullable(),
passkey_count: z.number().int().nonnegative().default(0),
created_at: z.string(),
updated_at: z.string(),
})
export type AdminUser = z.infer<typeof adminUserSchema>
export const passkeyCredentialSchema = z.object({
id: z.string(),
name: z.string(),
created_at: z.string(),
last_used_at: z.string().nullable(),
device_type: z.string().nullable(),
})
export type PasskeyCredential = z.infer<typeof passkeyCredentialSchema>
export const webauthnOptionsResponseSchema = z.object({
challenge_id: z.string(),
options: z.record(z.string(), z.unknown()),
})
export type WebauthnOptionsResponse = z.infer<
typeof webauthnOptionsResponseSchema
>
export const webauthnVerifyRequestSchema = z.object({
challenge_id: z.string().min(1),
response: z.unknown(),
return_to: z.string().url().optional(),
name: z.string().min(1).max(80).optional(),
})
export type WebauthnVerifyRequest = z.infer<typeof webauthnVerifyRequestSchema>
export const patchPasskeyRequestSchema = z.object({
name: z.string().min(1).max(80),
})
export type PatchPasskeyRequest = z.infer<typeof patchPasskeyRequestSchema>
export const adminSessionSchema = z.object({
id: z.string(),
user_id: z.string(),