Ignore auto login variable if it is empty
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-07-30 19:47:34 +02:00
parent 154551aeaf
commit 85ee2b2549
3 changed files with 12 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ pub struct AppConfig {
/// Unsecure : for development, bypass authentication, using the account with the given
/// email address by default
#[clap(long, env)]
pub unsecure_auto_login_email: Option<String>,
unsecure_auto_login_email: Option<String>,
/// PostgreSQL database host
#[clap(long, env, default_value = "localhost")]
@@ -148,9 +148,17 @@ impl AppConfig {
&ARGS
}
/// Get auto login email (if not empty)
pub fn unsecure_auto_login_email(&self) -> Option<&str> {
match self.unsecure_auto_login_email.as_deref() {
None | Some("") => None,
s => s,
}
}
/// Check if auth is disabled
pub fn is_auth_disabled(&self) -> bool {
self.unsecure_auto_login_email.is_some()
self.unsecure_auto_login_email().is_some()
}
/// Get auth cookie domain