SSOAuthenticationService: Handle login callback URL with HTML entities.

This commit is contained in:
SBiOSoftWhare
2021-06-28 16:49:05 +02:00
parent f26f8f1866
commit 38347a3fc5
2 changed files with 4 additions and 1 deletions
@@ -70,7 +70,9 @@ final class SSOAuthenticationService: NSObject {
}
func loginToken(from url: URL) -> String? {
guard let components = URLComponents(string: url.absoluteString) else {
// If needed convert URL string from HTML entities into correct character representations using UTF8 (like '&' with '&')
guard let sanitizedStringURL = url.absoluteString.replacingHTMLEntities(),
let components = URLComponents(string: sanitizedStringURL) else {
return nil
}
return components.vc_getQueryItemValue(for: SSOURLConstants.Parameters.callbackLoginToken)