Removed redudancies and loud error messages

This commit is contained in:
shockrah 2020-11-21 19:05:44 -08:00
parent f5f3df2ee2
commit 8661bcabe7

View File

@ -20,7 +20,6 @@ pub enum AuthReason {
fn valid_secret(given_pass: &str, hash: &str) -> bool {
let result = bcrypt::verify(given_pass, hash);
println!("\tGiven: {} \tRaw: {}\t{:?}", given_pass, hash, result);
return match result {
Ok(result) => result,
Err(e) => {
@ -76,7 +75,7 @@ pub async fn wall_entry(path: &str, pool: &Pool, params: &serde_json::Value) ->
let secret = secret_v.as_str().unwrap_or("");
return match Member::get(pool, id).await {
Response::Row(user) => {
if valid_secret(secret, &user.secret) == true && valid_perms(user, path){
if valid_secret(secret, &user.secret) && valid_perms(user, path){
Ok(AuthReason::Good)
}
else {