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

Apple SSO: Watch token refresh

Open chipsnyder opened this issue 3 years ago • 5 comments

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

Syncs the user login tokens to the watch to preserve session management.

To test

Setup

  1. Enable the Feature Flag signInWithApple
  2. Set your scheme to Staging

Testing

You'll want to perform these tests with Username and Password, and Apple SSO as the flow changes touched each path.

  1. Login on the App
  2. Open the watch app
  3. Trigger an account refresh if the app doesn't trigger one itself
    • The app can be slow to send messages on builds from Xcode so be patient.
  4. Expect to be logged in to the same account as the phone.
  5. Log out and try the other path.

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 14:10 chipsnyder

To add more info:

  • I tried with the flag disabled
  • Logged in with email/password
  • I briefly see my email
  • The interface changes to "Not Signed In"

leandroalonso avatar Oct 20 '22 13:10 leandroalonso

@leandroalonso 🤔

I wonder if I need to bring this downstream change up to this branch. I'll take a look today.

chipsnyder avatar Oct 20 '22 14:10 chipsnyder

@leandroalonso I believe that was the problem. Can you test this again?

chipsnyder avatar Oct 20 '22 18:10 chipsnyder

@chipsnyder I'll test again. However, I think we should expand this task's test scenario to ensure it doesn't affect any possible paths before merging. Here's my plan:

With the flag disabled

  1. Test a currently logged-in user, and make sure the app behaves correctly (maybe force some token refresh)
  2. Login with email/password and make sure the app behaves correctly

With the flag enabled

  1. Test a currently logged-in user, and make sure the app behaves correctly (maybe force some token refresh)
  2. Login with email/password and make sure the app behaves correctly
  3. Test a currently logged-in user that used Apple SSO, and make sure the app behaves correctly (maybe force some token refresh)
  4. Login with Apple SSO and make sure the app behaves correctly

leandroalonso avatar Oct 20 '22 19:10 leandroalonso

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 21 '22 21:10 CLAassistant