diff --git a/register.html b/register.html index 262eacf..a68f8d6 100644 --- a/register.html +++ b/register.html @@ -106,7 +106,7 @@ authenticatorData: Base64.fromUint8Array(new Uint8Array(assertion.response.authenticatorData), true), clientDataJSON: Base64.fromUint8Array(new Uint8Array(assertion.response.clientDataJSON), true), signature: Base64.fromUint8Array(new Uint8Array(assertion.response.signature), true), - userHandle: assertion.response.userHandle + userHandle: Base64.fromUint8Array(new Uint8Array(assertion.response.userHandle),true) }, }), }) diff --git a/src/services/auth.rs b/src/services/auth.rs index 7b08d53..e830d8a 100644 --- a/src/services/auth.rs +++ b/src/services/auth.rs @@ -280,7 +280,7 @@ pub async fn start_authentication( session: Session, Path(user_name): Path, ) -> Result { - info!("Start Authentication"); + info!("开始passkey 验证"); let pool = &state.db; // Remove any previous authentication that may have occurred from the session. let _ = session.remove::<(Uuid, PasskeyAuthentication)>("auth_state").await; @@ -347,7 +347,7 @@ pub async fn finish_authentication( .await .unwrap() .ok_or(WebauthnError::AuthenticationFailure.to_string())?; - + info!("已获得认证状态:uid:{}",user_id); let _ = session.remove::<(Uuid, PasskeyAuthentication)>("auth_state").await; let res = match state @@ -355,6 +355,7 @@ pub async fn finish_authentication( .finish_passkey_authentication(&auth, &auth_state) { Ok(auth_result) => { + info!("passkey认证通过:uid:{}",user_id); let uid = user_id.clone().to_string(); let records = sqlx::query!( "SELECT CREDENTIAL FROM CREDENTIALS WHERE USER_ID = $1;",