From 9539dfc394e44f1872aa079a0c828621446a4011 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 14 Apr 2021 18:57:01 +0300 Subject: [WIP] Fix silly bug --- src/handlers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/handlers.rs b/src/handlers.rs index 3cea02c..25b7098 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -152,7 +152,7 @@ pub async fn authenticate_user( return Ok(warp::reply::with_status(res_json, StatusCode::BAD_REQUEST)); } - let fingerprint = format!(Sha256::digest(&request.public_key.as_bytes())); + let fingerprint = format!("{:x}", Sha256::digest(&request.public_key.as_bytes())); let new_user = User { user_id: privileged_student_id, @@ -166,7 +166,7 @@ pub async fn authenticate_user( let mut userlist = RwLockUpgradableReadGuard::upgrade(userlist); - userlist.insert(fingerprint, new_user); + userlist.insert(fingerprint.clone(), new_user); let res_json = warp::reply::json(&GradeCoinResponse { res: ResponseType::Success, -- cgit v1.2.3-70-g09d2