mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-04 12:10:50 +03:00
returning empty string or username on has keyfile. updated register submodule commit
This commit is contained in:
parent
aa2839cdec
commit
319e30a0c6
@ -1 +1 @@
|
|||||||
Subproject commit a4a66d61fd31605148d9e1dc0498a0540188fd66
|
Subproject commit f51aa927c842e13ed3b80fc7de1976477f869601
|
@ -106,8 +106,19 @@ pub async fn register(
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn handle_has_keyfile(keyfile: Arc<Mutex<Option<Vec<u8>>>>) -> Result<impl Reply, Rejection> {
|
async fn handle_has_keyfile(keyfile: Arc<Mutex<Option<Vec<u8>>>>) -> Result<impl Reply, Rejection> {
|
||||||
|
|
||||||
|
let keyfile_lock = keyfile.lock().unwrap();
|
||||||
|
let encoded_keyfile = keyfile_lock.as_ref().unwrap();
|
||||||
|
let username: String = match encoded_keyfile.is_empty() {
|
||||||
|
true => "".to_string(),
|
||||||
|
false => {
|
||||||
|
let (user, ..): (String,) = bincode::deserialize(encoded_keyfile).unwrap();
|
||||||
|
user
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Ok(warp::reply::json(
|
Ok(warp::reply::json(
|
||||||
&keyfile.lock().unwrap().as_ref().unwrap().is_empty(),
|
&username
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user