ASWeb Auth error due to redirector encoding issueΒ #37
Description
Here is a workaround solution https://stackoverflow.com/a/65092728/14414215 but this also causes issue as there are 2 diff methods of handling the redirectUri depending on if user has the strava app installed on the phone or otherwise.
The percent encoding example (SO link above) is needed if the user does not have the strava app install on the phone. Hence, StravaSwift will fallback to using ASWebAuth.
However, when using this percentEncoding solution, this would then break the authentication callback when the user has the Strava App in the phone. This would then return as "FALSE" once user has fully authenticated in the strava app and returned back to the originating app. (this then breaks the app)
My solution was to do something dumb to this line.
Basically, replacing the occurrence of the PercentEncoding back to "://" else the comparison (url.absoluteString.starts(with: redirectUri),)
fails.
if let redirectUri = config?.redirectUri.components(separatedBy: "%3A%2F%2F").joined(separator: "://"), url.absoluteString.starts(with: redirectUri),