fix(auth): persist ToS acceptance in Rust/SQLite backend
ToS acceptance was stored in localStorage which gets cleared on app updates, causing users to re-login frequently. Now stores ToS state in SQLite (~/.local/share/qbz/legal_settings.db) which survives updates. - Add legal_settings.rs with SQLite storage for ToS acceptance - Update qobuzLegalStore.ts to use Rust invoke commands - LoginView now loads ToS from Rust before auto-login check - Migration from localStorage for existing users Closes #31
This commit is contained in:
1 parent
fe7816f6c6
commit
3926209b0d
5 files changed
+212
-8
No files matched your search
@@ -196,6 +196,13 @@ pub fn run() {
|
||||
// Initialize tray settings state
|
||||
let tray_settings_state = config::tray_settings::TraySettingsState::new()
|
||||
.expect("Failed to initialize tray settings");
|
||||
// Initialize legal settings state (ToS acceptance persistence)
|
||||
let legal_settings_state = config::legal_settings::LegalSettingsState::new(
|
||||
std::sync::Mutex::new(
|
||||
config::legal_settings::LegalSettingsStore::new()
|
||||
.expect("Failed to initialize legal settings")
|
||||
)
|
||||
);
|
||||
// Initialize updates state
|
||||
let updates_state = updates::UpdatesState::new()
|
||||
.expect("Failed to initialize updates state");
|
||||
@@ -442,6 +449,7 @@ pub fn run() {
|
||||
.manage(favorites_prefs_state)
|
||||
.manage(favorites_cache_state)
|
||||
.manage(tray_settings_state)
|
||||
.manage(legal_settings_state)
|
||||
.manage(updates_state)
|
||||
.manage(musicbrainz_state)
|
||||
.manage(listenbrainz_state)
|
||||
@@ -841,6 +849,10 @@ pub fn run() {
|
||||
config::tray_settings::set_enable_tray,
|
||||
config::tray_settings::set_minimize_to_tray,
|
||||
config::tray_settings::set_close_to_tray,
|
||||
// Legal settings commands
|
||||
config::legal_settings::get_legal_settings,
|
||||
config::legal_settings::get_qobuz_tos_accepted,
|
||||
config::legal_settings::set_qobuz_tos_accepted,
|
||||
// MusicBrainz integration commands
|
||||
commands::musicbrainz_resolve_track,
|
||||
commands::musicbrainz_resolve_artist,
|
||||
|
||||
Reference in new issue
Block a user