mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-25 07:18:35 -06:00
fix: Do not consider empty password
This commit is contained in:
parent
514e905299
commit
06f7a33d5d
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue