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:
Claude committed 2026-10-04 18:48:11 +00:00
1 parent d1a95ccab4
commit 124240daea
6 files changed
+40 -24

No files matched your search

+12 -2
View File
@@ -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(())
+9 -17
View File
@@ -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());
+3
View File
@@ -292,6 +292,9 @@ export component MainWindow inherits Window {
y: parent.height - self.height - (Nav.narrow ? 140px : 96px);
text: Bridge.status-text;
visible: self.shown && !Bridge.myts.prompt;
// A notice from the start (an imported identity) waits for the
// account prompt to close.
paused: Bridge.myts.prompt;
widest: min(560px, parent.width - 32px);
}
+3 -1
View File
@@ -234,6 +234,8 @@ export component Toast inherits Rectangle {
in property <image> icon: Icons.info;
in property <duration> timeout: 5s;
in-out property <bool> shown;
// Hidden for now (under the account prompt): the time to read starts later.
in property <bool> paused;
// The widest it gets (e.g. the window less a margin); longer text wraps.
in property <length> widest: 560px;
height: shown ? row.preferred-height + 16px : 0px;
@@ -248,7 +250,7 @@ export component Toast inherits Rectangle {
accessible-live-region: polite;
Timer {
interval: root.timeout;
running: root.shown;
running: root.shown && !root.paused;
triggered => { root.shown = false; }
}
TouchArea {
+4 -2
View File
@@ -16,7 +16,9 @@ component LoginForm inherits VerticalLayout {
spacing: Theme.space-3;
property <string> otp-text;
function submit() {
if !Bridge.myts.busy && email.text != "" && password.text != "" && (!Bridge.myts.otp-required || otp-text != "") {
// The one-time code is asked for, never required to submit: another
// account needs none, and without it a 2FA account is asked again.
if !Bridge.myts.busy && email.text != "" && password.text != "" {
Bridge.myts-login(email.text, password.text, otp-text);
password.clear();
otp-text = "";
@@ -52,7 +54,7 @@ component LoginForm inherits VerticalLayout {
}
Button {
text: @tr("Sign in");
enabled: !Bridge.myts.busy && email.text != "" && password.text != "" && (!Bridge.myts.otp-required || root.otp-text != "");
enabled: !Bridge.myts.busy && email.text != "" && password.text != "";
clicked => { root.submit(); }
}
Button {