merge upstream main
This commit is contained in:
@@ -14,6 +14,7 @@ export interface SystemSettings {
|
||||
email_verify_enabled: boolean
|
||||
promo_code_enabled: boolean
|
||||
password_reset_enabled: boolean
|
||||
invitation_code_enabled: boolean
|
||||
totp_enabled: boolean // TOTP 双因素认证
|
||||
totp_encryption_key_configured: boolean // TOTP 加密密钥是否已配置
|
||||
// Default settings
|
||||
@@ -72,6 +73,7 @@ export interface UpdateSettingsRequest {
|
||||
email_verify_enabled?: boolean
|
||||
promo_code_enabled?: boolean
|
||||
password_reset_enabled?: boolean
|
||||
invitation_code_enabled?: boolean
|
||||
totp_enabled?: boolean // TOTP 双因素认证
|
||||
default_balance?: number
|
||||
default_concurrency?: number
|
||||
|
||||
@@ -164,6 +164,24 @@ export async function validatePromoCode(code: string): Promise<ValidatePromoCode
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate invitation code response
|
||||
*/
|
||||
export interface ValidateInvitationCodeResponse {
|
||||
valid: boolean
|
||||
error_code?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate invitation code (public endpoint, no auth required)
|
||||
* @param code - Invitation code to validate
|
||||
* @returns Validation result
|
||||
*/
|
||||
export async function validateInvitationCode(code: string): Promise<ValidateInvitationCodeResponse> {
|
||||
const { data } = await apiClient.post<ValidateInvitationCodeResponse>('/auth/validate-invitation-code', { code })
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* Forgot password request
|
||||
*/
|
||||
@@ -229,6 +247,7 @@ export const authAPI = {
|
||||
getPublicSettings,
|
||||
sendVerifyCode,
|
||||
validatePromoCode,
|
||||
validateInvitationCode,
|
||||
forgotPassword,
|
||||
resetPassword
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user