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
301301 taskId = UIBackgroundTaskInvalid;
302302 }];
303303
304+ UIViewController *presentingViewController = appDelegate.window .rootViewController .view .window ? appDelegate.window .rootViewController : appDelegate.window .rootViewController .presentedViewController ;
305+
304306 if (skipCodeExchange) {
305307 _currentSession = [OIDAuthorizationService presentAuthorizationRequest: request
306- presentingViewController: appDelegate.window.rootViewController
308+ presentingViewController: presentingViewController
307309 callback: ^(OIDAuthorizationResponse *_Nullable authorizationResponse, NSError *_Nullable error) {
308310 typeof (self) strongSelf = weakSelf;
309311 strongSelf->_currentSession = nil ;
@@ -318,7 +320,7 @@ - (void)authorizeWithConfiguration: (OIDServiceConfiguration *) configuration
318320 }]; // end [OIDAuthState presentAuthorizationRequest:request
319321 } else {
320322 _currentSession = [OIDAuthState authStateByPresentingAuthorizationRequest: request
321- presentingViewController: appDelegate.window.rootViewController
323+ presentingViewController: presentingViewController
322324 callback: ^(OIDAuthState *_Nullable authState,
323325 NSError *_Nullable error) {
324326 typeof (self) strongSelf = weakSelf;
You can’t perform that action at this time.
0 commit comments