1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 07:38:36 -06:00

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

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