Skip to content

Commit

Permalink
Fix error reading
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasman committed Apr 5, 2024
1 parent a927ee1 commit b6702ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/TeslaSwift/TeslaSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b6702ec

Please sign in to comment.