Handle FxA Sign-in flow in IPProtectionService
Categories
(Firefox :: IP Protection, task, P3)
Tracking
()
People
(Reporter: fchasen, Assigned: rking)
References
Details
(Whiteboard: [fx-vpn])
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Will need to be similar to SpecialMessageActions.fxaSignInFlow where we open a new tab a listen for the UIState to update, canceling if the tab closes but:
- Will need to stay open at the end of the flow.
- Will need to open the panel after a successful sign in or up.
| Reporter | ||
Updated•3 months ago
|
Updated•3 months ago
|
| Reporter | ||
Updated•3 months ago
|
| Reporter | ||
Comment 1•3 months ago
|
||
Will also need to update the message CTA to use this new flow.
| Reporter | ||
Comment 2•2 months ago
|
||
Since this flow will need to be handled in the panel and a cta, we should add a new action to call a method on the IPProtectionService to trigger the flow like is done here: https://searchfox.org/mozilla-central/source/toolkit/components/messaging-system/lib/SpecialMessageActions.sys.mjs#761-764
| Reporter | ||
Comment 3•2 months ago
|
||
A few updates on this, thankfully we can just pass a data attribute to keep the tab open after the fxaSignInFlow so no need recreate that.
Will need to a listener in IPProtectionPanel for when IPProtectionSignedOutContentElement dispatches "IPProtection:SignIn".
Handler for that listener should call a new method on the IPProtectionService that will take a window param and use the SpecialMessageActions.fxaSignInFlow(data, browser) and if it was successful and if so open the panel. (No need to set the isSignedIn state as that will be passed in the SignedIn event).
The data will need to include autoClose: false and an extraParams: {} with entries that match what we were passing in the sign link url (but each url param as an entry in the object.
The browser is available as window.gBrowser.
We don't currently have a panel opening method, so will need to add one in the IPProtectionService that takes a window param so we open it in the current window. I used this in the demo:
async openPanel(window) {
let widget = lazy.CustomizableUI.getWidget(IPProtectionService.WIDGET_ID);
let anchor = widget.forWindow(window).anchor;
await window.PanelUI.showSubView(IPProtectionService.PANEL_ID, anchor);
}
(You will need to import CustomizableUI add the WIDGET_ID and PANEL_ID static constant to IPProtectionService for that to work though)
Our new case in SpecialMessageActions.handleAction (like https://searchfox.org/mozilla-central/source/toolkit/components/messaging-system/lib/SpecialMessageActions.sys.mjs#777) will also need to call this new method from IPProtectionService.
Updated•2 months ago
|
Original Revision: https://phabricator.services.mozilla.com/D260878
Updated•2 months ago
|
Comment 7•2 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: Unable to access IP protection experiment
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: None
- Risk associated with taking this patch: Low
- Explanation of risk level: Only affects IP protection experiment, which is only about 1,000 users
- String changes made/needed: None
- Is Android affected?: no
Comment 8•2 months ago
|
||
| bugherder | ||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 10•2 months ago
|
||
I have verified that this issue is no longer reproducible using the latest Firefox Nightly 144.0a1 and Firefox Beta 143.0b2, installed on Windows 11 x64.
Clicking the "Next" button from Signed out panel redirects user to sign in and the correct link with mentioned param is loaded.
Updated•2 months ago
|
Updated•2 months ago
|
Description
•