feat: use the homeserver url from the wellknown file for JWT check (MESSENGER-6777)

This commit is contained in:
Jan Niklas Grabowski
2025-01-23 14:01:23 +01:00
parent 284119937f
commit 54d655212c
4 changed files with 86 additions and 34 deletions
@@ -205,6 +205,20 @@ class AuthenticationService: NSObject {
delegate?.authenticationService(self, didReceive: token, with: transactionID) ?? false
}
/// BWI: #6777 use baseURL for JWT handling
func getBaseURL(_ homeserverAddress: String) async -> String? {
guard let homeserverURL = URL(string: homeserverAddress) else {
return nil
}
guard let wellKnown = try? await wellKnown(for: homeserverURL) else {
return nil
}
return wellKnown.homeServer.baseUrl
}
/// BWI END
// MARK: - Private
/// Query the supported login flows for the supplied homeserver.