New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SIWA] Handle credential state changes #12585
[SIWA] Handle credential state changes #12585
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One request for a change to fix a bug I found. We can address it separately if you like, but it might make sense to roll it in here :)
DDLogInfo("checkAppleIDCredentialState: Unauthorized Apple ID. User signed out.") | ||
switch state { | ||
case .revoked: | ||
DDLogInfo("checkAppleIDCredentialState: Revoked Apple ID. User signed out.") | ||
self?.logOutDefaultWordPressComAccount() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also ensure we delete the Apple ID from the keychain on log out. I noticed an issue with my device where it somehow still has the Apple ID in the keychain, even though I logged out and logged back in with a different account. Because of this, each time we do the apple credential state check here, the app sees I have a revoked ID and logs me out again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @frosty . Nice catch! It has been done. See what you think now. Thanks!
Ref #12399
Related WPAuth PR: wordpress-mobile/WordPressAuthenticator-iOS#139
This uses the WPAuth changes to:
CredentialState
provided by WPAuth.revoked
, log out of the account.There should be no visible difference from the previous implementation.
To test:
This should be tested on a real device for proper keychain handling.
Update release notes:
RELEASE-NOTES.txt
if necessary.