voelin-ui: account portal on Windows, demo mode, notices and one-time codes
- The account website actions said "Could not open your browser" on every click on Windows (explorer exits with 1 on success) and waited for the browser to close with a foreground xdg-open: success is that the opener started, as for files (open_target). - VOELIN_DEMO_UI's account screens signed in and out for real and could delete or replace the developer's saved session: demo mode uses an in-memory secret store and its sign-in and sign-out do nothing. - A notice from the start (an imported identity) ran out behind the account prompt: the toast's time starts when the prompt closes. - After an account asked for a one-time code, signing in was blocked until one was typed, also for another account: the code field shows but no longer blocks; a 2FA account without it is asked again. - SECURITY.md lists the myTeamSpeak secrets in the keyring, the account service the app talks to, and that servers get the account's id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEpqsPES27Eacue91u3d2Q
This commit is contained in:
1 parent
d1a95ccab4
commit
124240daea
6 files changed
+40
-24
No files matched your search
@@ -665,7 +665,10 @@ pub fn run(options: RunOptions) -> Result<()> {
|
||||
myts: Default::default(),
|
||||
ui: ui.as_weak(),
|
||||
store,
|
||||
secrets: options.secrets.unwrap_or_else(default_secrets),
|
||||
// The sample data of VOELIN_DEMO_UI never reaches the system keyring.
|
||||
secrets: options.secrets.unwrap_or_else(|| {
|
||||
if switches.demo_ui { Box::new(MemorySecrets::default()) } else { default_secrets() }
|
||||
}),
|
||||
engine: engine.clone(),
|
||||
identity,
|
||||
current: bookmarks.first().map(|b| b.id),
|
||||
@@ -779,7 +782,14 @@ pub fn run(options: RunOptions) -> Result<()> {
|
||||
|
||||
/// Open a file or folder with the desktop's default application.
|
||||
pub(crate) fn open_path(path: &Path) -> std::io::Result<()> {
|
||||
let mut child = desktop_opener(path.as_os_str()).spawn()?;
|
||||
open_target(path.as_os_str())
|
||||
}
|
||||
|
||||
/// Open a file, folder or address with the desktop's handler. Success is that
|
||||
/// the opener started: explorer's exit code means nothing (1 on success), and
|
||||
/// xdg-open may wait until the browser closes.
|
||||
pub(crate) fn open_target(target: &std::ffi::OsStr) -> std::io::Result<()> {
|
||||
let mut child = desktop_opener(target).spawn()?;
|
||||
// Reap it without blocking the UI.
|
||||
std::thread::spawn(move || child.wait());
|
||||
Ok(())
|
||||
|
||||
@@ -251,22 +251,9 @@ impl App {
|
||||
let Some(url) = portal_url(action).filter(|_| !self.myts.busy) else {
|
||||
return;
|
||||
};
|
||||
let generation = self.myts.generation;
|
||||
self.runtime.spawn(async move {
|
||||
let opened = tokio::task::spawn_blocking(move || {
|
||||
crate::app::desktop_opener(std::ffi::OsStr::new(url))
|
||||
.status()
|
||||
.is_ok_and(|status| status.success())
|
||||
})
|
||||
.await
|
||||
.unwrap_or(false);
|
||||
later(move |app| {
|
||||
if app.myts.generation == generation && !app.myts.busy {
|
||||
app.myts.status = if opened { 11 } else { 10 };
|
||||
app.refresh_myts();
|
||||
}
|
||||
});
|
||||
});
|
||||
let opened = crate::app::open_target(std::ffi::OsStr::new(url)).is_ok();
|
||||
self.myts.status = if opened { 11 } else { 10 };
|
||||
self.refresh_myts();
|
||||
}
|
||||
|
||||
pub(crate) fn myts_retry(&mut self) {
|
||||
@@ -313,7 +300,8 @@ impl App {
|
||||
}
|
||||
|
||||
pub(crate) fn myts_login(&mut self, email: String, password: String, otp: String) {
|
||||
if email.trim().is_empty() || password.is_empty() || self.myts.signed_in {
|
||||
// The sample screens of VOELIN_DEMO_UI sign in nowhere.
|
||||
if self.demo_ui || email.trim().is_empty() || password.is_empty() || self.myts.signed_in {
|
||||
return;
|
||||
}
|
||||
let (device, otp_renewal) = self.myts.device_for(&email);
|
||||
@@ -378,6 +366,10 @@ impl App {
|
||||
}
|
||||
|
||||
pub(crate) fn myts_logout(&mut self) {
|
||||
// Nor do they sign out: no session, keyring or engine account to clear.
|
||||
if self.demo_ui {
|
||||
return;
|
||||
}
|
||||
let token =
|
||||
self.myts.saved.as_ref().and_then(|s| SessionToken::new(s.session.clone()).ok());
|
||||
let cleared = self.myts.forget(self.secrets.as_ref());
|
||||
|
||||
Reference in new issue
Block a user