mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-21 16:56:46 +00:00
fix: Do not consider empty password
This commit is contained in:
parent
514e905299
commit
06f7a33d5d
@ -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 New Issue
Block a user