mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-02 18:31:50 -04:00
refactor: more logs
This commit is contained in:
parent
94a2cd2886
commit
f6ceb5ac0a
@ -64,9 +64,9 @@ impl TryFrom<Option<&str>> for AuthRequest {
|
|||||||
pub(crate) struct AuthData {
|
pub(crate) struct AuthData {
|
||||||
#[redact]
|
#[redact]
|
||||||
username: Option<String>,
|
username: Option<String>,
|
||||||
#[redact(fixed = 10)]
|
#[redact]
|
||||||
prelogin_cookie: Option<String>,
|
prelogin_cookie: Option<String>,
|
||||||
#[redact(fixed = 10)]
|
#[redact]
|
||||||
portal_userauthcookie: Option<String>,
|
portal_userauthcookie: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,8 +84,11 @@ impl AuthData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn check(&self) -> bool {
|
fn check(&self) -> bool {
|
||||||
self.username.is_some()
|
let username_valid = self.username.clone().is_some_and(|username| !username.is_empty());
|
||||||
&& (self.prelogin_cookie.is_some() || self.portal_userauthcookie.is_some())
|
let prelogin_cookie_valid = self.prelogin_cookie.clone().is_some_and(|val| val.len() > 5);
|
||||||
|
let portal_userauthcookie_valid = self.portal_userauthcookie.clone().is_some_and(|val| val.len() > 5);
|
||||||
|
|
||||||
|
username_valid && (prelogin_cookie_valid || portal_userauthcookie_valid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user