mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
fix: enable passphrase reset with MAS (MESSENGER-7861)
This commit is contained in:
@@ -14,5 +14,8 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
@interface WebViewViewController : MXKWebViewViewController
|
||||
|
||||
// bwi #7861 we need to enable javascript only for reauthentication
|
||||
- (void) enableJavascript:(BOOL)enable;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -86,4 +86,12 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
[super setLocalHTMLFile:localHTMLFile];
|
||||
}
|
||||
|
||||
// bwi #7861 we need to enable javascript only for reauthentication
|
||||
- (void)enableJavascript:(BOOL)enable {
|
||||
if (webView) {
|
||||
webView.configuration.preferences.javaScriptEnabled = enable;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -53,6 +53,9 @@ NSString *FallBackViewControllerJavascriptOnLogin = @"window.matrixLogin.onLogin
|
||||
// the user agent to bypass the limitation of Google, as a quick fix (a proper solution will be to use the SSO SDK)
|
||||
webView.customUserAgent = @"Mozilla/5.0";
|
||||
|
||||
// bwi #7861 this webview needs javascript to function on MAS setups
|
||||
[self enableJavascript:YES];
|
||||
|
||||
[self clearCookies];
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,9 @@ final class ReauthenticationCoordinator: ReauthenticationCoordinatorType {
|
||||
// NOTE: Prefer use a callback and the same mechanism as SSOAuthentificationSession instead of using custom WKWebView
|
||||
let reauthFallbackViewController: ReauthFallBackViewController = ReauthFallBackViewController(url: authenticationURL.absoluteString)
|
||||
reauthFallbackViewController.title = self.parameters.title
|
||||
|
||||
|
||||
reauthFallbackViewController.enableJavascript(true)
|
||||
|
||||
reauthFallbackViewController.didCancel = { [weak self] in
|
||||
guard let self = self else {
|
||||
return
|
||||
@@ -153,7 +155,7 @@ final class ReauthenticationCoordinator: ReauthenticationCoordinatorType {
|
||||
guard let self = self else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
guard let sessionId = authenticationSession.session else {
|
||||
self.delegate?.reauthenticationCoordinator(self, didFailWithError: ReauthenticationCoordinatorError.failToBuildPasswordParameters)
|
||||
return
|
||||
@@ -161,10 +163,13 @@ final class ReauthenticationCoordinator: ReauthenticationCoordinatorType {
|
||||
|
||||
let authenticationParameters = self.authenticationParametersBuilder.buildOAuthParameters(with: sessionId)
|
||||
self.delegate?.reauthenticationCoordinatorDidComplete(self, withAuthenticationParameters: authenticationParameters)
|
||||
|
||||
self.presentingViewController.dismiss(animated: true)
|
||||
}
|
||||
|
||||
let navigationController = RiotNavigationController(rootViewController: reauthFallbackViewController)
|
||||
|
||||
// bwi #7861 close buttons should close the view
|
||||
self.presentingViewController.present(navigationController, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user