fix: Do not consider empty password

This commit is contained in:
Sayantan Santra 2024-10-02 23:52:23 -05:00
parent 514e905299
commit 06f7a33d5d
Signed by: SinTan1729
GPG Key ID: 0538DD402EA50898
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}