mozilla / fxa

Monorepo for Mozilla Accounts (formerly Firefox Accounts)
https://mozilla.github.io/ecosystem-platform/
Mozilla Public License 2.0
575 stars 209 forks source link

fix(sync): Send fxaLogout message on settings sign out if sync #17187

Closed LZoog closed 1 week ago

LZoog commented 1 week ago

Because:

This commit:

closes FXA-9919


Info

Product confirmed on Slack that this is the fix we want to implement. In at least iOS there's a menu that still comes up once the command is received for logout, see video/thread, and our mobile clients will update their response to the command to close this menu. Users caught in this state now are instructed to sign out of the browser and sign back in through the browser, since they're being redirected to oauth/signin under the hood, which expects a client_id query parameter.

The diff looks large, but the only real change happened in DropDownAvatarMenu. The rest is the result of some prop drilling and mock cleanup.

Testing

The error shown is different in Backbone and React (see ticket). To test this, first reproduce on main by following our instructions to set up at least iOS in XCode.` Create an account and enable 2FA (can do this part on desktop), then go into account settings from the browser menu in mobile and sign out through the drop down menu. Close out and try to access settings again in the same way and you'll see the error per the ticket.

In this branch, the error is avoided because on sign out, the user is signed out of the browser. The easiest way to test this for React signin is to turn signInRoutes.fullProdRollout to true in react-app/index.js. This can also be tested in desktop via our fxa-dev-launcher command where you should be able to just run yarn start, to confirm that the user is signed out of the desktop browser as well on Settings sign out after signing in or signing up for an account in React.

LZoog commented 1 week ago

Going to go ahead and merge since the only failures are netlify which we can safely ignore.