Skip to content

Instantly share code, notes, and snippets.

@boucher
Created April 4, 2010 21:52
Show Gist options
  • Save boucher/355732 to your computer and use it in GitHub Desktop.
Save boucher/355732 to your computer and use it in GitHub Desktop.
- (void)connectionDidReceiveAuthenticationChallenge:(CPURLConnection)aConnection
{
_loginConnection = aConnection;
[[LoginPanel sharedLoginPanel] beginWithModalDelegate:self
didEndSelector:@selector(processLogin:result:context:)
contextInfo:nil];
}
- (void)processLogin:(id)sender result:(const)result context:(id)contextInfo
{
if(result == LOGIN_SUCCESS)
{
[_loginConnection cancel];
[_loginConnection start];
}
else
[[_loginConnection delegate] connection:_loginConnection didFailWithError: [_loginConnection _XMLHTTPRequest].responseText];
_loginConnection = nil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment