You've already forked hotpocket
BTHLABS-66: Prepping for public release: Take three
I smell a drastic change to auth flow in the Mac app... Let's see if it gets approved this time :D.
This commit is contained in:
@@ -31,19 +31,31 @@
|
||||
#pragma mark - Actions
|
||||
|
||||
-(IBAction)doStartAuthorizationFlow:(id)sender {
|
||||
AppDelegate *appDeleate = [[NSApplication sharedApplication] delegate];
|
||||
appDeleate.authFlow.baseURL = [NSURL URLWithString:self.baseURL];
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.alertStyle = NSAlertStyleInformational;
|
||||
alert.messageText = NSLocalizedString(@"Continue in the browser", @"Continue in the browser");
|
||||
alert.informativeText = NSLocalizedString(@"HotPocket will now open the instance in your browser and you can continue to sign in.", @"HotPocket will now open the instance in your browser and you can continue to sign in.");
|
||||
|
||||
NSURL *authURL = [appDeleate.authFlow start];
|
||||
if (authURL == nil) {
|
||||
NSBeep();
|
||||
return;
|
||||
}
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"Let's go!", @"Let's go!")];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel")];
|
||||
|
||||
[alert beginSheetModalForWindow:self.view.window completionHandler:^(NSModalResponse response) {
|
||||
if (response == NSAlertFirstButtonReturn) {
|
||||
AppDelegate *appDeleate = [[NSApplication sharedApplication] delegate];
|
||||
appDeleate.authFlow.baseURL = [NSURL URLWithString:self.baseURL];
|
||||
|
||||
NSURL *authURL = [appDeleate.authFlow start];
|
||||
if (authURL == nil) {
|
||||
NSBeep();
|
||||
return;
|
||||
}
|
||||
|
||||
AuthorizationProgressViewController *authProgressViewController = [self.storyboard instantiateControllerWithIdentifier:@"AuthorizationProgressViewController"];
|
||||
[self presentViewController:authProgressViewController animator:[[ReplaceAnimator alloc] init]];
|
||||
|
||||
[[NSWorkspace sharedWorkspace] openURL:authURL];
|
||||
AuthorizationProgressViewController *authProgressViewController = [self.storyboard instantiateControllerWithIdentifier:@"AuthorizationProgressViewController"];
|
||||
[self presentViewController:authProgressViewController animator:[[ReplaceAnimator alloc] init]];
|
||||
|
||||
[[NSWorkspace sharedWorkspace] openURL:authURL];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user