fix: default browser not working on some os

This commit is contained in:
Kevin Yue
2024-10-31 06:31:54 +00:00
parent ed413ee029
commit 222fe26cea
3 changed files with 173 additions and 18 deletions

View File

@@ -35,8 +35,9 @@ which.workspace = true
tauri = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
open = { version = "5", optional = true }
webbrowser = { version = "1", optional = true }
[features]
tauri = ["dep:tauri"]
clap = ["dep:clap"]
browser-auth = ["dep:open"]
browser-auth = ["dep:open", "dep:webbrowser"]

View File

@@ -52,7 +52,7 @@ impl BrowserAuthenticator<'_> {
open::with_detached(path.as_ref(), app)?;
} else {
info!("Launching the default browser...");
open::that_detached(path.as_ref())?;
webbrowser::open(path.as_ref())?;
}
Ok(())