From 06f7a33d5ddb3173144240ae5fa6a1e9521739b9 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Wed, 2 Oct 2024 23:52:23 -0500 Subject: [PATCH] fix: Do not consider empty password --- actix/src/auth.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/actix/src/auth.rs b/actix/src/auth.rs index a87b0bf..3ca4495 100644 --- a/actix/src/auth.rs +++ b/actix/src/auth.rs @@ -7,7 +7,11 @@ use std::{env, time::SystemTime}; // Validate a given password pub fn validate(session: Session) -> bool { // If there's no password provided, just return true - if env::var("password").is_err() { + if env::var("password") + .ok() + .filter(|s| !s.trim().is_empty()) + .is_none() + { return true; }