From 7714233a2c9d75e5b96075b8866db4eeca67e58c Mon Sep 17 00:00:00 2001 From: Emilie Balland Date: Fri, 14 Sep 2018 14:46:28 +0200 Subject: [PATCH] never delete refresh token when refreshing Otherwise this may cause any error or loss of connectivity leading to refresh token deletion. There is a pending PR on the main repo https://github.com/p2/OAuth2/pull/281 Related to sensational/popscan-android#977 --- Sources/Flows/OAuth2.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/Flows/OAuth2.swift b/Sources/Flows/OAuth2.swift index ab2886fc..c5976c14 100644 --- a/Sources/Flows/OAuth2.swift +++ b/Sources/Flows/OAuth2.swift @@ -374,7 +374,6 @@ open class OAuth2: OAuth2Base { let data = try response.responseData() let json = try self.parseRefreshTokenResponseData(data) if response.response.statusCode >= 400 { - self.clientConfig.refreshToken = nil throw OAuth2Error.generic("Failed with status \(response.response.statusCode)") } self.logger?.debug("OAuth2", msg: "Did use refresh token for access token [\(nil != self.clientConfig.accessToken)]")