Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only attempt to refresh auth token when user is authenticated (#3721)
Task/Issue URL: https://app.asana.com/0/414709148257752/1208966018277167/f **Description**: Following [Increase of 401s in auth api - Darwin](https://app.asana.com/0/0/1208959507432558) we found that the refreshAuthTokenIfNeeded is being called without a proper check if user is authenticated (and tokens are present). It also includes BSK check -> duckduckgo/BrowserServicesKit@fb809ed **Steps to test this PR**: 1. Ensure no PP is on the device 2. Open PP purchase page 3. Check if `refreshAuthTokenIfNeeded` was not called and no calls to `validate_token` endpoint were made. 4. Purchase or activate subscription 5. Open add/edit email page 6. Check if `refreshAuthTokenIfNeeded` was properly called with a call to `validate_token` endpoint. **Definition of Done (Internal Only)**: * [ ] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? **Copy Testing**: * [ ] Use of correct apostrophes in new copy, ie `’` rather than `'` **Orientation Testing**: * [ ] Portrait * [ ] Landscape **Device Testing**: * [ ] iPhone SE (1st Gen) * [ ] iPhone 8 * [ ] iPhone X * [ ] iPhone 14 Pro * [ ] iPad **OS Testing**: * [ ] iOS 15 * [ ] iOS 16 * [ ] iOS 17 **Theme Testing**: * [ ] Light theme * [ ] Dark theme --- ###### Internal references: [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943)
- Loading branch information