Widgets: Attempt to re-register for a scalar token if ours is invalid

#2326

As the integration manager page (https://scalar-staging.riot.im/scalar-web) does not return a 403, check scalar token validity before opening it
This commit is contained in:
manuroe
2019-03-12 17:12:44 +01:00
parent 887660ed26
commit f8ea427b62
5 changed files with 126 additions and 54 deletions
@@ -73,7 +73,7 @@ NSString *const kIntegrationManagerAddIntegrationScreen = @"add_integ";
// Make sure we have a scalar token
MXWeakify(self);
operation = [[WidgetManager sharedManager] getScalarTokenForMXSession:mxSession success:^(NSString *theScalarToken) {
operation = [[WidgetManager sharedManager] getScalarTokenForMXSession:mxSession validate:YES success:^(NSString *theScalarToken) {
MXStrongifyAndReturnIfNil(self);
self->operation = nil;