diff --git a/ios/A0Auth0.m b/ios/A0Auth0.m index 01220a24..db9f883d 100644 --- a/ios/A0Auth0.m +++ b/ios/A0Auth0.m @@ -127,7 +127,7 @@ - (void)safariViewControllerDidFinish:(SFSafariViewController *)controller { - (void)safariViewController:(SFSafariViewController *)controller didCompleteInitialLoad:(BOOL)didLoadSuccessfully { if (self.closeOnLoad && didLoadSuccessfully) { - [self terminateWithError:nil dismissing:YES animated:YES]; + [self terminateWithError:[NSNull null] dismissing:YES animated:YES]; } else if (!didLoadSuccessfully) { NSDictionary *error = @{ @"error": @"a0.session.failed_load", diff --git a/webauth/agent.js b/webauth/agent.js index 1bb5824b..7dc978bb 100644 --- a/webauth/agent.js +++ b/webauth/agent.js @@ -17,7 +17,11 @@ export default class Agent { Linking.addEventListener('url', urlHandler); A0Auth0.showUrl(url, closeOnLoad, (err) => { Linking.removeEventListener('url', urlHandler); - reject(err); + if (err) { + reject(err); + } else if (closeOnLoad) { + resolve(); + } }); }); }