迁移后端认证与拆分 Spacetime 客户端
This commit is contained in:
@@ -153,6 +153,13 @@ pub async fn phone_login(
|
||||
&session_client,
|
||||
AuthLoginMethod::Phone,
|
||||
)?;
|
||||
state
|
||||
.sync_auth_store_snapshot_to_spacetime()
|
||||
.await
|
||||
.map_err(|error| {
|
||||
AppError::from_status(StatusCode::INTERNAL_SERVER_ERROR)
|
||||
.with_message(format!("同步认证快照失败:{error}"))
|
||||
})?;
|
||||
|
||||
let mut headers = HeaderMap::new();
|
||||
attach_set_cookie_header(
|
||||
@@ -177,6 +184,7 @@ fn map_phone_auth_scene(raw_scene: Option<&str>) -> Result<PhoneAuthScene, AppEr
|
||||
"login" => Ok(PhoneAuthScene::Login),
|
||||
"bind_phone" => Ok(PhoneAuthScene::BindPhone),
|
||||
"change_phone" => Ok(PhoneAuthScene::ChangePhone),
|
||||
"reset_password" => Ok(PhoneAuthScene::ResetPassword),
|
||||
_ => Err(AppError::from_status(StatusCode::BAD_REQUEST)
|
||||
.with_message("短信验证码场景不合法")
|
||||
.with_details(json!({ "field": "scene" }))),
|
||||
@@ -214,7 +222,7 @@ fn mask_phone_digits(value: &str) -> String {
|
||||
masked
|
||||
}
|
||||
|
||||
fn map_phone_auth_error(error: PhoneAuthError) -> AppError {
|
||||
pub fn map_phone_auth_error(error: PhoneAuthError) -> AppError {
|
||||
match error {
|
||||
PhoneAuthError::InvalidPhoneNumber
|
||||
| PhoneAuthError::InvalidVerifyCode
|
||||
|
||||
Reference in New Issue
Block a user