From bc37e0140b91a7d173289f26a8b6bfe50f31d936 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 15 Feb 2025 02:17:26 +1100 Subject: [PATCH] fix(gui-client): allow sign-in without saving token to keyring (#8129) Alternative to #8128. If the user dismissed the unlock prompt or has their keyring otherwise misconfigured, it is still useful to allow them to sign-in. They just won't stay signed-in across reboots of the device. --- rust/gui-client/src-common/src/auth.rs | 10 ++++++++-- website/src/components/Changelog/GUI.tsx | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/rust/gui-client/src-common/src/auth.rs b/rust/gui-client/src-common/src/auth.rs index cb7e97081..778a890d6 100644 --- a/rust/gui-client/src-common/src/auth.rs +++ b/rust/gui-client/src-common/src/auth.rs @@ -1,6 +1,6 @@ //! Fulfills -use anyhow::Result; +use anyhow::{Context, Result}; use firezone_headless_client::known_dirs; use firezone_logging::err_with_src; use rand::{thread_rng, RngCore}; @@ -201,7 +201,13 @@ impl Auth { fn save_session(&self, session: &Session, token: &SecretString) -> Result<(), Error> { // This MUST be the only place the GUI can call `set_password`, since // the actor name is also saved here. - self.token_store.set_password(token.expose_secret())?; + if let Err(e) = self + .token_store + .set_password(token.expose_secret()) + .context("Failed to save token in keyring") + { + tracing::info!("{e:#}"); // Log that we couldn't save it and allow the user to continue anyway. + } save_file(&actor_name_path()?, session.actor_name.as_bytes())?; save_file( &session_data_path()?, diff --git a/website/src/components/Changelog/GUI.tsx b/website/src/components/Changelog/GUI.tsx index bd64ece45..69f1289da 100644 --- a/website/src/components/Changelog/GUI.tsx +++ b/website/src/components/Changelog/GUI.tsx @@ -14,6 +14,9 @@ export default function GUI({ os }: { os: OS }) { Fixes an upload speed performance regression. )} + + Allows signing-in without access to the local keyring. +