Authentication: Fix registration cancellation

Bug Fix: https://github.com/vector-im/vector-ios/issues/240
This commit is contained in:
giomfo 2016-04-21 17:53:52 +02:00
parent 548db6a303
commit e04c768170
2 changed files with 15 additions and 2 deletions

View file

@ -154,8 +154,8 @@
// Check whether a request is in progress
if (!self.userInteractionEnabled)
{
// Cancel the current operation, and reset the UI by forcing the authType property.
self.authType = self.authType;
// Cancel the current operation
[self cancel];
}
else if (self.authType == MXKAuthenticationTypeLogin)
{

View file

@ -65,6 +65,13 @@
// Validate first the provided session
MXAuthenticationSession *validSession = [self validateAuthenticationSession:authSession];
// Cancel email validation if any
if (submittedEmail)
{
[submittedEmail cancelCurrentRequest];
submittedEmail = nil;
}
// Reset UI by hidding all items
[self hideInputsContainer];
@ -311,6 +318,12 @@
NSLog(@"[AuthInputsView] Failed to request email token: %@", error);
// Ignore connection cancellation error
if (([error.domain isEqualToString:NSURLErrorDomain] && error.code == NSURLErrorCancelled))
{
return;
}
callback(nil);
}];