fix(passkey): 删除 passkey 先确认并显示名称与注册时间,邮箱未验证时后端拒删最后一把,错误内联显示
This commit is contained in:
16 files changed
+355
-59
No files matched your search
@@ -13,6 +13,7 @@ import type {
|
||||
LinkResult,
|
||||
LinkStatus,
|
||||
BindResult,
|
||||
PasskeyCredential,
|
||||
PatchUserRequest,
|
||||
PlayersResult,
|
||||
QuotaInput,
|
||||
@@ -560,7 +561,7 @@ export const api = rejectingSync({
|
||||
request<any>("POST", "/account/passkey/register/finish", { name, attestation }),
|
||||
|
||||
passkeyList: () =>
|
||||
request<{ credentials: any[] }>("GET", "/account/passkey/credentials"),
|
||||
request<{ credentials: PasskeyCredential[] }>("GET", "/account/passkey/credentials"),
|
||||
|
||||
passkeyDelete: (id: string) =>
|
||||
request<void>("DELETE", urlPath`/account/passkey/credentials/${id}`),
|
||||
@@ -800,6 +801,8 @@ export function humanizeError(e: unknown): string {
|
||||
return t("passkey_already_bound");
|
||||
case "passkey_unavailable":
|
||||
return t("passkey_unavailable");
|
||||
case "last_passkey":
|
||||
return t("last_passkey");
|
||||
case "quota_exceeded":
|
||||
return t("quota_exceeded");
|
||||
case "already_claimed":
|
||||
|
||||
@@ -392,6 +392,15 @@ export interface QuotaInput {
|
||||
max_storage_gb?: number | null;
|
||||
}
|
||||
|
||||
// One registered passkey as GET /account/passkey/credentials lists it.
|
||||
export interface PasskeyCredential {
|
||||
id: string;
|
||||
name: string;
|
||||
aaguid?: string;
|
||||
created_at: string;
|
||||
last_used_at?: string | null;
|
||||
}
|
||||
|
||||
export interface SessionView {
|
||||
token_hash: string;
|
||||
created_at: string;
|
||||
|
||||
Reference in new issue
Block a user