mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-02-03 02:37:37 +01:00
Delete authentication credentials from Keychain upon logout
Fixes #1181
This commit is contained in:
parent
ab75f08e8f
commit
1a1eecac64
@ -30,7 +30,8 @@ public class AuthenticationServiceProvider: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func delete(authentication: MastodonAuthentication) {
|
||||
func delete(authentication: MastodonAuthentication) throws {
|
||||
try Self.keychain.remove(authentication.persistenceIdentifier)
|
||||
authentications.removeAll(where: { $0 == authentication })
|
||||
}
|
||||
|
||||
|
@ -150,8 +150,12 @@ extension AuthenticationService {
|
||||
for feed in feeds {
|
||||
managedObjectContext.delete(feed)
|
||||
}
|
||||
|
||||
AuthenticationServiceProvider.shared.delete(authentication: authenticationBox.authentication)
|
||||
}
|
||||
|
||||
do {
|
||||
try AuthenticationServiceProvider.shared.delete(authentication: authenticationBox.authentication)
|
||||
} catch {
|
||||
assertionFailure("Failed to delete Authentication: \(error)")
|
||||
}
|
||||
|
||||
// cancel push notification subscription
|
||||
|
Loading…
x
Reference in New Issue
Block a user