Fix refresh token coding and persistence.

This commit is contained in:
David Langley
2021-12-13 16:29:02 +00:00
parent 947290b6a7
commit 3155bf8ca0
2 changed files with 23 additions and 25 deletions

View File

@@ -66,6 +66,8 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
// Load existing accounts from local storage
[self loadAccounts];
[self registerRestClientDidRefreshTokensNotification];
}
return self;
}
@@ -723,4 +725,17 @@ NSString *const MXKAccountManagerDataType = @"org.matrix.kit.MXKAccountManagerDa
}
}
#pragma mark - Homeserver Access/Refresh Token updates
- (void)registerRestClientDidRefreshTokensNotification
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleRestClientDidRefreshTokensNotification:) name:MXRestClientDidRefreshTokensNotification object:nil];
}
- (void)handleRestClientDidRefreshTokensNotification:(NSNotification*)notification
{
[self saveAccounts];
}
@end