@@ -15,6 +15,9 @@ import (
|
||||
// errorResponse 是统一错误响应外壳。
|
||||
type errorResponse struct {
|
||||
Error string `json:"error"`
|
||||
// Code 是机器可读错误码,多数错误不携带;当前仅全局 IP 限流的 429
|
||||
// 返回 "RateLimited",前端据此与登录守卫的 429(无 code)区分
|
||||
Code string `json:"code,omitempty"`
|
||||
}
|
||||
|
||||
// itemsResponse 是 {"items": [...]} 列表外壳。
|
||||
@@ -71,6 +74,20 @@ type credentialsResponse struct {
|
||||
type oauthProvidersResponse struct {
|
||||
Providers []service.ProviderInfo `json:"providers"`
|
||||
PasswordLoginDisabled bool `json:"passwordLoginDisabled"`
|
||||
PasskeyLogin bool `json:"passkeyLogin"`
|
||||
WalletLogin bool `json:"walletLogin"`
|
||||
}
|
||||
|
||||
// walletChallengeResponse 是钱包签名挑战响应;message 需原样 personal_sign。
|
||||
type walletChallengeResponse struct {
|
||||
Nonce string `json:"nonce"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// passkeyOptionsResponse 是 WebAuthn 仪式 options 响应;sessionId 需原样带回 finish。
|
||||
type passkeyOptionsResponse struct {
|
||||
SessionId string `json:"sessionId"`
|
||||
Options json.RawMessage `json:"options"`
|
||||
}
|
||||
|
||||
// urlResponse 是跳转地址响应。
|
||||
|
||||
Reference in New Issue
Block a user