Universal link + next link: Logout and show Authentication screen anytime the user click on an email validation link

This commit is contained in:
manuroe
2016-04-21 17:49:52 +02:00
parent d58016b47b
commit 78565218b5
3 changed files with 39 additions and 6 deletions
+20 -5
View File
@@ -44,10 +44,11 @@
MXHTTPOperation *roomCreationRequest;
/**
Observer that check when the Authentification view controller has gone.
*/
// Observer that checks when the Authentification view controller has gone.
id authViewControllerObserver;
// The paratemers to pass to the Authentification view controller.
NSDictionary *authViewControllerNextLinkParameters;
}
@end
@@ -255,10 +256,17 @@
- (void)showAuthenticationScreen
{
[self showAuthenticationScreenWithNextLinkParameters:nil];
}
- (void)showAuthenticationScreenWithNextLinkParameters:(NSDictionary *)nextLinkParameters
{
authViewControllerNextLinkParameters = nextLinkParameters;
[[AppDelegate theDelegate] restoreInitialDisplay:^{
[self performSegueWithIdentifier:@"showAuth" sender:self];
}];
}
@@ -552,6 +560,13 @@
[[NSNotificationCenter defaultCenter] removeObserver:authViewControllerObserver];
authViewControllerObserver = nil;
}];
// Forward parameters if any
if (authViewControllerNextLinkParameters)
{
[_authViewController registerWithNextLinkParameters:authViewControllerNextLinkParameters];
authViewControllerNextLinkParameters = nil;
}
}
}