diff --git a/Classes/BITAuthenticationViewController.m b/Classes/BITAuthenticationViewController.m index d9ee0205b1..974a4a3064 100644 --- a/Classes/BITAuthenticationViewController.m +++ b/Classes/BITAuthenticationViewController.m @@ -294,8 +294,8 @@ } - (void) setLoginUIEnabled:(BOOL) enabled { - self.navigationItem.rightBarButtonItem.enabled = !enabled; - self.tableView.userInteractionEnabled = !enabled; + self.navigationItem.rightBarButtonItem.enabled = enabled; + self.tableView.userInteractionEnabled = enabled; } @end diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index d1d559c58c..28e1e3bf12 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -300,13 +300,18 @@ static NSString* const kBITAuthenticatorDidSkipOptionalLogin = @"BITAuthenticato NSError *authParseError = nil; NSString *authToken = [strongSelf.class authenticationTokenFromReponse:response error:&authParseError]; + NSError *error = nil; if(nil == authToken) { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil - message:@"Failed to authenticate" - delegate:nil - cancelButtonTitle:BITHockeyLocalizedString(@"OK") - otherButtonTitles:nil]; - [alert show]; + if([authParseError.domain isEqualToString:kBITAuthenticatorErrorDomain] && + authParseError.code == BITAuthenticatorNotAuthorized) { + error = [NSError errorWithDomain:kBITAuthenticatorErrorDomain + code:BITAuthenticatorNotAuthorized + userInfo:@{ + //TODO localize + NSLocalizedDescriptionKey : @"Not authorized", + NSUnderlyingErrorKey : authParseError + }]; + } completion(NO, error); } else { //no need to call completion, we're dismissing it anyways