Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions MASFoundation/Classes/models/MASBrowserBasedAuthentication.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,24 +207,15 @@ -(void)launchBrowserWithURL:(NSURL*)templatizedURL
__block MASBrowserBasedAuthentication *blockSelf = self;
__weak __typeof__(self) weakSelf = self;
blockSelf.safariViewController = [[SFSafariViewController alloc] initWithURL:templatizedURL];

if (@available(iOS 11.0, *)) {
blockSelf.safariViewController.dismissButtonStyle = SFSafariViewControllerDismissButtonStyleCancel;
}
else {
// Fallback on earlier versions
}
blockSelf.safariViewController.delegate = weakSelf;

__block UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:blockSelf.safariViewController];
blockSelf.safariViewController.delegate = weakSelf;

dispatch_async(dispatch_get_main_queue(), ^{
[UIAlertController rootViewController].modalTransitionStyle = UIModalTransitionStyleCoverVertical;

[[UIAlertController rootViewController] presentViewController:navigationController animated:YES
[[UIAlertController rootViewController] presentViewController:blockSelf.safariViewController animated:YES
completion:^{

navigationController = nil;
DLog(@"Successfully displayed login template");
}];

return;
Expand Down