aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYigit Sever2021-04-14 18:57:01 +0300
committerYigit Sever2021-04-14 19:12:51 +0300
commitffb79ec042e73c62dae31b4138517bd3e739c6b9 (patch)
treeb9b0ce7cb49d1fc2d96dcaeeaba52880c9934391 /src
parent2f40619a7e3088472e963e899837698ef48b7330 (diff)
downloadgradecoin-ffb79ec042e73c62dae31b4138517bd3e739c6b9.tar.gz
gradecoin-ffb79ec042e73c62dae31b4138517bd3e739c6b9.tar.bz2
gradecoin-ffb79ec042e73c62dae31b4138517bd3e739c6b9.zip
[WIP] Fix silly bug
Diffstat (limited to 'src')
-rw-r--r--src/handlers.rs4
1 files changed, 2 insertions, 2 deletions
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(
152 return Ok(warp::reply::with_status(res_json, StatusCode::BAD_REQUEST)); 152 return Ok(warp::reply::with_status(res_json, StatusCode::BAD_REQUEST));
153 } 153 }
154 154
155 let fingerprint = format!(Sha256::digest(&request.public_key.as_bytes())); 155 let fingerprint = format!("{:x}", Sha256::digest(&request.public_key.as_bytes()));
156 156
157 let new_user = User { 157 let new_user = User {
158 user_id: privileged_student_id, 158 user_id: privileged_student_id,
@@ -166,7 +166,7 @@ pub async fn authenticate_user(
166 166
167 let mut userlist = RwLockUpgradableReadGuard::upgrade(userlist); 167 let mut userlist = RwLockUpgradableReadGuard::upgrade(userlist);
168 168
169 userlist.insert(fingerprint, new_user); 169 userlist.insert(fingerprint.clone(), new_user);
170 170
171 let res_json = warp::reply::json(&GradeCoinResponse { 171 let res_json = warp::reply::json(&GradeCoinResponse {
172 res: ResponseType::Success, 172 res: ResponseType::Success,