StravaSwift icon indicating copy to clipboard operation
StravaSwift copied to clipboard

After kill the app - how can we refresh the token to avoid re-authorisation

Open sathishchinniah04 opened this issue 3 years ago • 1 comments

At first time all good, after we kill the app and relaunch every-time its asking for authorisation. Is there any way to re-authorise by having the previous token ?

Tried :

public func refreshAccessToken(_ refreshToken: String, result: @escaping AuthorizationHandler) {}

But not getting the result of OAuthToken

sathishchinniah04 avatar Jan 11 '22 13:01 sathishchinniah04

This is how I'm using the refreshAccessToken

 StravaClient.sharedInstance.refreshAccessToken(sRefreshToken) { result in
          switch result {
          case .success(let token):
            let accessToken = token.accessToken
            let refreshToken = token.refreshToken
            
          case .failure(let error):
            debugPrint(error)
          }
        }

mjunkmyjunk avatar Feb 22 '22 02:02 mjunkmyjunk