Fix Apple Sign In token path#25710
Conversation
The `lodashGet` call was causing an error, saying webpack couldn't load
the module, at least when used with ngrok.
```
Uncaught TypeError: lodash_get__WEBPACK_IMPORTED_MODULE_4___default()(...) is undefined
lodashGet index.website.js:20
successListener index.website.js:57
ge appleid.auth.js:26
we appleid.auth.js:26
<anonymous> appleid.auth.js:26
<anonymous> appleid.auth.js:26
<anonymous> appleid.auth.js:26
EventListener.handleEvent* appleid.auth.js:26
```
Remove the call so that it's more easily testable. Developers can
override values just fine, and QA won't need it.
cefc840 to
89d0945
Compare
|
@allroundexperts Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
|
Hi @allroundexperts, sorry I will complete the checklist to merge it and CP it to staging since it's a straightforward fix |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Fix Apple Sign In token path (cherry picked from commit 7640a6f)
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.3.56-11 🚀
|
|
✅ Verified the fix on staging following the CP |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.3.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.58-5 🚀
|
Details
Fixes the path where we access the Apple Sign-In token.
Also removes the lodashGet call from the success listener, as it was erroring when testing with ngrok:
Not sure why it's undefined, but we don't need it. Updated the contributing guide accordingly.
Fixed Issues
$ #25697
PROPOSAL: #25697 (comment)
Tests
This flow is only fully testable on staging, as it requires a configured HTTPS domain name matching Expensify's Apple configuration. In the meantime, we checked that the idToken param is selected correctly:
Session.beginAppleSignIn(I was having issues with the debugger/console logging when running on ngrok, so I usedwindow.alert, which worked well)idTokenis set as expectedSignInWithApplecommand is sent with theidTokenform parameter in the browser inspectorOffline tests
n/a
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Showing alert debug statement with token of appropriate length:
successfulwindowalert.mov
Showing idToken param in SignInWithAppleRequest:
showIdTokenParam.mov
We don't expect the request to succeed since it isn't signed appropriately for the Expensify API backend's configuration.
Mobile Web - Chrome
n/a
Mobile Web - Safari
n/a
Desktop
n/a
iOS
n/a
Android
n/a