pocket-casts-ios icon indicating copy to clipboard operation
pocket-casts-ios copied to clipboard

Apple SSO: Consolidate Token Refresh paths

Open chipsnyder opened this issue 3 years ago • 3 comments

📘 Project: #381 Depends on #409
📓 For Apple SSO testing: In my testing, Apple SSO didn't always return the email in the simulator, so testing with a physical device is recommended.

Consolidates the refresh password token flow to use the existing API methods.

The token refresh methods have a 30.seconds timeout which seems very long, especially when the default is already 15.seconds, so I didn't maintain the 30.seconds period when porting to the existing methods.

I did, however, modify the login paths (SSO and Username/Password) to use the .reloadIgnoringLocalCacheData policy, as that just seems wise for auth calls.

To test

This can be tested with the same process as https://github.com/Automattic/pocket-casts-ios/pull/392 but using Username and Password log in instead of SSO

Checklist

  • [x] I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • [x] I have considered adding unit tests for my changes.
  • [ ] I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

chipsnyder avatar Oct 18 '22 20:10 chipsnyder

@chipsnyder it looks like there are build errors on this PR. 🤔

leandroalonso avatar Oct 19 '22 13:10 leandroalonso

😅 Got moving too fast yesterday and didn't push the last change to this branch.

chipsnyder avatar Oct 19 '22 13:10 chipsnyder

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 21 '22 21:10 CLAassistant

There are some changes coming to the login/token endpoints that will require more changes how we handle the token refresh/etc. So I am going to close this for now and revisit these improvements later.

emilylaguna avatar Nov 02 '22 21:11 emilylaguna