File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -301,9 +301,11 @@ - (void)authorizeWithConfiguration: (OIDServiceConfiguration *) configuration
301
301
taskId = UIBackgroundTaskInvalid;
302
302
}];
303
303
304
+ UIViewController *presentingViewController = appDelegate.window .rootViewController .view .window ? appDelegate.window .rootViewController : appDelegate.window .rootViewController .presentedViewController ;
305
+
304
306
if (skipCodeExchange) {
305
307
_currentSession = [OIDAuthorizationService presentAuthorizationRequest: request
306
- presentingViewController: appDelegate.window.rootViewController
308
+ presentingViewController: presentingViewController
307
309
callback: ^(OIDAuthorizationResponse *_Nullable authorizationResponse, NSError *_Nullable error) {
308
310
typeof (self) strongSelf = weakSelf;
309
311
strongSelf->_currentSession = nil ;
@@ -318,7 +320,7 @@ - (void)authorizeWithConfiguration: (OIDServiceConfiguration *) configuration
318
320
}]; // end [OIDAuthState presentAuthorizationRequest:request
319
321
} else {
320
322
_currentSession = [OIDAuthState authStateByPresentingAuthorizationRequest: request
321
- presentingViewController: appDelegate.window.rootViewController
323
+ presentingViewController: presentingViewController
322
324
callback: ^(OIDAuthState *_Nullable authState,
323
325
NSError *_Nullable error) {
324
326
typeof (self) strongSelf = weakSelf;
You can’t perform that action at this time.
0 commit comments