mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 15:52:40 +00:00
Authentication: Fix registration cancellation
Bug Fix: https://github.com/vector-im/vector-ios/issues/240
This commit is contained in:
parent
548db6a303
commit
e04c768170
2 changed files with 15 additions and 2 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
}];
|
||||
|
|
Loading…
Reference in a new issue