Fix/修复登录用户参数等错误被上报 #567

Merged
k88936 merged 77 commits from fix/wrong-report into master 2026-10-02 15:02:27 +08:00
24 changed files with 81 additions and 129 deletions
Showing only changes of commit 3ecee09431 - Show all commits
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 认证网络客户端构建失败。
*/
export type AuthClientInitFailed = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 连接 / 超时 / DNS 等网络失败。
*/
export type AuthNetworkUnavailable = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 响应不是合法 JSON、缺少必需字段或契约不成立。
*/
export type AuthResponseMalformed = { message: string };
@@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 登录服务在响应体里显式拒绝时给的原文。
*/
export type AuthResponseServerRejected = { serverMessage: string | null };
@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 服务端 5xx。
* 登录服务 5xx 的状态码。
*/
export type AuthServiceUnavailable = { status: number; message: string };
export type AuthServiceUnavailable = { status: number };
@@ -1,44 +1,44 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AuthClientInitFailed } from './AuthClientInitFailed';
import type { AuthNetworkUnavailable } from './AuthNetworkUnavailable';
import type { AuthResponseMalformed } from './AuthResponseMalformed';
import type { AuthResponseServerRejected } from './AuthResponseServerRejected';
import type { AuthServiceUnavailable } from './AuthServiceUnavailable';
import type { ClientSessionPersistFailed } from './ClientSessionPersistFailed';
import type { LoginCodeMissing } from './LoginCodeMissing';
import type { PasswordEntryInputRejected } from './PasswordEntryInputRejected';
import type { PasswordMissing } from './PasswordMissing';
import type { PermissionDenied } from './PermissionDenied';
import type { PhoneLoginInputRejected } from './PhoneLoginInputRejected';
import type { PhoneNumberInvalid } from './PhoneNumberInvalid';
import type { PhoneOrPasswordMismatch } from './PhoneOrPasswordMismatch';
import type { PasswordLoginRejected } from './PasswordLoginRejected';
import type { PhoneCodeLoginRejected } from './PhoneCodeLoginRejected';
import type { RuntimeSessionInstallFailed } from './RuntimeSessionInstallFailed';
import type { SendCodeInputRejected } from './SendCodeInputRejected';
import type { ServerAddressRejected } from './ServerAddressRejected';
import type { SessionAuthorityRejected } from './SessionAuthorityRejected';
import type { SmsCodeInvalidOrExpired } from './SmsCodeInvalidOrExpired';
import type { SmsCodeThrottled } from './SmsCodeThrottled';
import type { SendCodeRejected } from './SendCodeRejected';
import type { UnexpectedRejection } from './UnexpectedRejection';
/**
* 变体名就是线上的分流键(`type`),每个变体持有同名载荷类型。
* 变体名就是线上的分流键(`type`),带载荷的变体持有同名载荷类型。
*/
export type ClientAuthError =
| ({ type: 'serverAddressRejected' } & ServerAddressRejected)
| ({ type: 'phoneNumberInvalid' } & PhoneNumberInvalid)
| ({ type: 'passwordMissing' } & PasswordMissing)
| ({ type: 'loginCodeMissing' } & LoginCodeMissing)
| ({ type: 'passwordEntryInputRejected' } & PasswordEntryInputRejected)
| ({ type: 'phoneOrPasswordMismatch' } & PhoneOrPasswordMismatch)
| ({ type: 'sendCodeInputRejected' } & SendCodeInputRejected)
| ({ type: 'smsCodeThrottled' } & SmsCodeThrottled)
| ({ type: 'phoneLoginInputRejected' } & PhoneLoginInputRejected)
| ({ type: 'smsCodeInvalidOrExpired' } & SmsCodeInvalidOrExpired)
| ({ type: 'sessionAuthorityRejected' } & SessionAuthorityRejected)
| ({ type: 'permissionDenied' } & PermissionDenied)
| ({ type: 'authNetworkUnavailable' } & AuthNetworkUnavailable)
| { type: 'serverAddressEmptyOrTooLong' }
| { type: 'serverAddressNotAUrl' }
| { type: 'serverAddressHasCredentials' }
| { type: 'serverAddressHasPathOrQueryOrFragment' }
| { type: 'serverAddressNotHttps' }
| { type: 'serverAddressUnsupportedScheme' }
| { type: 'serverAddressOutsideChannel' }
| { type: 'phoneNumberInvalid' }
| { type: 'passwordMissing' }
| { type: 'loginCodeMissing' }
| ({ type: 'passwordLoginRejected' } & PasswordLoginRejected)
| { type: 'phoneOrPasswordMismatch' }
| ({ type: 'sendCodeRejected' } & SendCodeRejected)
| { type: 'smsCodeThrottled' }
| ({ type: 'phoneCodeLoginRejected' } & PhoneCodeLoginRejected)
| { type: 'smsCodeRejected' }
| { type: 'sessionInvalidated' }
| { type: 'permissionDenied' }
| { type: 'authNetworkTimeout' }
| { type: 'authNetworkUnreachable' }
| ({ type: 'authServiceUnavailable' } & AuthServiceUnavailable)
| ({ type: 'unexpectedRejection' } & UnexpectedRejection)
| ({ type: 'authResponseMalformed' } & AuthResponseMalformed)
| { type: 'authResponseNotJson' }
| { type: 'authResponseInvalidBody' }
| { type: 'authResponseMissingRefreshCookie' }
| { type: 'authResponseMissingUserIdentity' }
| ({ type: 'authResponseServerRejected' } & AuthResponseServerRejected)
| ({ type: 'clientSessionPersistFailed' } & ClientSessionPersistFailed)
| ({ type: 'runtimeSessionInstallFailed' } & RuntimeSessionInstallFailed)
| ({ type: 'authClientInitFailed' } & AuthClientInitFailed);
| { type: 'authClientInitFailed' };
@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 本机登录凭据文件读写失败。
* 本机凭据文件读写的原始错误明细。
*/
export type ClientSessionPersistFailed = { message: string };
export type ClientSessionPersistFailed = { detail: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 本地前置校验:验证码为空。
*/
export type LoginCodeMissing = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/entry` 返回 400:服务端拒绝本次输入。
*/
export type PasswordEntryInputRejected = { message: string };
@@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/entry` 返回 400 时服务端给的原文。
*/
export type PasswordLoginRejected = {
/**
* 服务端原文可能缺失:缺失是 `None`,Rust 不编造兜底文案。
*/
serverMessage: string | null;
};
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 本地前置校验:密码为空。
*/
export type PasswordMissing = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 会话路由 403:当前账号没有执行此操作的权限。
*/
export type PermissionDenied = { message: string };
@@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/phone/login` 返回 400 时服务端给的原文。
*/
export type PhoneCodeLoginRejected = {
/**
* 服务端原文可能缺失:缺失是 `None`,Rust 不编造兜底文案。
*/
serverMessage: string | null;
};
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/phone/login` 返回 400。
*/
export type PhoneLoginInputRejected = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 本地前置校验:手机号为空或格式不合法。
*/
export type PhoneNumberInvalid = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/entry` 返回 401:手机号或密码错误。
*/
export type PhoneOrPasswordMismatch = { message: string };
@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 本机运行时会话安装 / 清理失败。
* 本机运行时会话安装 / 清理的原始错误明细。
*/
export type RuntimeSessionInstallFailed = { message: string };
export type RuntimeSessionInstallFailed = { detail: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/phone/send-code` 返回 400。
*/
export type SendCodeInputRejected = { message: string };
@@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/phone/send-code` 返回 400 时服务端给的原文。
*/
export type SendCodeRejected = {
/**
* 服务端原文可能缺失:缺失是 `None`,Rust 不编造兜底文案。
*/
serverMessage: string | null;
};
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 服务地址不是合法 origin / 非本机未用 HTTPS / 不在构建渠道范围内。
*/
export type ServerAddressRejected = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 会话路由 401:登录态权威失效。
*/
export type SessionAuthorityRejected = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/phone/login` 返回 401:验证码错误或过期。
*/
export type SmsCodeInvalidOrExpired = { message: string };
@@ -1,6 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* `/api/auth/phone/send-code` 返回 429:发送过于频繁。
*/
export type SmsCodeThrottled = { message: string };
@@ -1,6 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* 其它未识别的拒绝(未列举的 4xx、登录路由 403 等)。
* 其它未识别拒绝的状态码与服务端原文。
*/
export type UnexpectedRejection = { status: number; message: string };
export type UnexpectedRejection = {
status: number;
serverMessage: string | null;
};