update default browser

This commit is contained in:
Kevin Yue 2024-10-31 14:31:13 +00:00
parent 222fe26cea
commit 6542d677a9
No known key found for this signature in database
GPG Key ID: 4D3A6EE977B15AC4

View File

@ -17,9 +17,14 @@ impl BrowserAuthenticator<'_> {
}
pub fn new_with_browser<'a>(auth_request: &'a str, browser: &'a str) -> BrowserAuthenticator<'a> {
let browser = browser.trim();
BrowserAuthenticator {
auth_request,
browser: if browser == "default" { None } else { Some(browser) },
browser: if browser.is_empty() || browser == "default" {
None
} else {
Some(browser)
},
}
}