fix: Do not consider empty password

This commit is contained in:
SinTan1729 2024-10-02 23:52:23 -05:00
parent 514e905299
commit 06f7a33d5d
No known key found for this signature in database
GPG Key ID: 0538DD402EA50898

View File

@ -7,7 +7,11 @@ use std::{env, time::SystemTime};
// Validate a given password // Validate a given password
pub fn validate(session: Session) -> bool { pub fn validate(session: Session) -> bool {
// If there's no password provided, just return true // 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; return true;
} }