App: Refresh Tokens Implementation#5293
Merged
Conversation
…stence and NotificationService handling.
3 tasks
Member
Author
|
|
…ut side effects. Also change force reload of accounts to stop double load on init.
…to langleyd/5292_refresh_tokens
- Remove some duplication of logout behaviour - Fix additional spinner on homeViewController
|
📱 Scan the QR code below to install the build for this PR. If you can't scan the QR code you can install the build via this link: https://i.diawi.com/xLodiE |
pixlwave
reviewed
Jan 14, 2022
…to langleyd/5292_refresh_tokens
…to langleyd/5292_refresh_tokens
…ithub.com/vector-im/element-ios into langleyd/5292_refresh_tokens" This reverts commit 2f00672, reversing changes made to e785179.
ismailgulek
reviewed
Jan 27, 2022
ismailgulek
approved these changes
Jan 28, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #5292
Dependant on matrix-org/matrix-ios-sdk#1319
Included in this PR
BuildSettings.authEnableRefreshTokenswhich enables refresh token auth on the client, which takes effect on the next user login. I the user is already logged in access token auth will remain in use until the user logs out.MXKAccountcoding so that it is persisted when accounts are saved.MXRestClientDidRefreshTokensNotificationand save accounts when the tokens change.MXKAccountDataclass fromMXKAccountthat contains just the codable data so that we can read/write account data to disk without the sideeffects that occur with in MXKAccount.MXKAccountDatato read credentials from disk and write them back in a single transaction using NSFileCoordinator. This is used within the refresh token flow to avoid data race conditions/corruption when refreshing tokens across processes (App + Notification, Sharing, Siri extensions).HomeViewControllerWithBannerWrapperViewController. It now passes start/stop events through to the underlyingHomeViewControllerwhich correctly listens to sync events via inheritingMXKViewController.Todo: