From 75e7adc72a9a53d99b8a3db691004b6fa6d03bf4 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 31 Mar 2022 12:35:40 +0300 Subject: [PATCH] Resetting stored tokens on any login restoration failures. --- .../Services/Authentication/AuthenticationCoordinator.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ElementX/Sources/Services/Authentication/AuthenticationCoordinator.swift b/ElementX/Sources/Services/Authentication/AuthenticationCoordinator.swift index cca975c22..ed0c58bd1 100644 --- a/ElementX/Sources/Services/Authentication/AuthenticationCoordinator.swift +++ b/ElementX/Sources/Services/Authentication/AuthenticationCoordinator.swift @@ -68,6 +68,10 @@ class AuthenticationCoordinator: Coordinator { case .failure(let error): self.delegate?.authenticationCoordinator(self, didFailWithError: error) MXLog.error("Failed restoring login with error: \(error)") + + // On any restoration failure reset the token and restart + self.keychainController.removeAllTokens() + self.start() } } }