SSOAuthenticationService: Handle login callback URL with HTML entities.

This commit is contained in:
SBiOSoftWhare 2021-06-28 16:49:05 +02:00
parent 8fd1e91558
commit 71cbee1b8a
2 changed files with 4 additions and 1 deletions

View file

@ -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)

View file

@ -4,6 +4,7 @@
@import MatrixSDK;
@import MatrixKit;
@import DTCoreText;
#import "WebViewViewController.h"
#import "RiotSplitViewController.h"