From b6702eca7bca03a56f086ba20bb1ec1deb77ad38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nunes?= Date: Sat, 6 Apr 2024 01:53:05 +0300 Subject: [PATCH] Fix error reading --- Sources/TeslaSwift/TeslaSwift.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/TeslaSwift/TeslaSwift.swift b/Sources/TeslaSwift/TeslaSwift.swift index a23e522..3fd32d3 100644 --- a/Sources/TeslaSwift/TeslaSwift.swift +++ b/Sources/TeslaSwift/TeslaSwift.swift @@ -721,7 +721,7 @@ extension TeslaSwift { } else if httpResponse.allHeaderFields["Www-Authenticate"] != nil, httpResponse.statusCode == 401 { throw TeslaError.authenticationFailed } else if let mapped = try? teslaJSONDecoder.decode(ErrorMessage.self, from: data) { - if mapped.description == "invalid bearer token" { + if mapped.error == "invalid bearer token" { token?.expiresIn = 0 throw TeslaError.tokenRevoked } else {