...
This commit is contained in:
parent
05763e7dd3
commit
1ea0b97f6d
49 changed files with 869 additions and 289 deletions
|
|
@ -1,18 +0,0 @@
|
|||
use json::JsonValue;
|
||||
|
||||
use crate::util::file_util::load_file;
|
||||
// NOT USED AT MOMENT
|
||||
pub fn is_private_key_valid(user_id: &i64, key_hash: &str) -> bool {
|
||||
let file_contents = load_file("", "users.json");
|
||||
|
||||
let users = json::parse(&file_contents).unwrap();
|
||||
if let JsonValue::Array(users_array) = users {
|
||||
for user in users_array {
|
||||
if user["uuid"] == user_id.to_string() && user["private_key_hash"] == key_hash {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
Loading…
Reference in a new issue