fix(desktop): clear stored credentials on logout
All user-initiated logouts now pass deleteKey=true to remove nsec from secure storage, clear last_npub, and delete bunker state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -199,7 +199,7 @@ fun main() =
|
||||
"Logout",
|
||||
onClick = {
|
||||
deckScope.launch {
|
||||
accountManager.logout()
|
||||
accountManager.logout(deleteKey = true)
|
||||
}
|
||||
},
|
||||
enabled = accountState is AccountState.LoggedIn,
|
||||
@@ -429,7 +429,7 @@ fun App(
|
||||
}
|
||||
if (connected == null) {
|
||||
// No relays connected after 30s — fall back to login screen
|
||||
accountManager.logout()
|
||||
accountManager.logout(deleteKey = true)
|
||||
} else {
|
||||
val result = accountManager.loadSavedAccount(relayManager.client)
|
||||
if (result.isSuccess) {
|
||||
@@ -743,7 +743,7 @@ fun ProfileScreen(
|
||||
Spacer(Modifier.height(24.dp))
|
||||
|
||||
OutlinedButton(
|
||||
onClick = { scope.launch { accountManager.logout() } },
|
||||
onClick = { scope.launch { accountManager.logout(deleteKey = true) } },
|
||||
colors =
|
||||
androidx.compose.material3.ButtonDefaults.outlinedButtonColors(
|
||||
contentColor = Color.Red,
|
||||
@@ -951,7 +951,7 @@ fun RelaySettingsScreen(
|
||||
|
||||
val logoutScope = rememberCoroutineScope()
|
||||
OutlinedButton(
|
||||
onClick = { logoutScope.launch { accountManager.logout() } },
|
||||
onClick = { logoutScope.launch { accountManager.logout(deleteKey = true) } },
|
||||
colors =
|
||||
ButtonDefaults.outlinedButtonColors(
|
||||
contentColor = MaterialTheme.colorScheme.error,
|
||||
|
||||
Reference in New Issue
Block a user