HomePhabricator
Diffusion Comm e399279d27eb

[lib/web] Route to a barebones QR code login page

Description

[lib/web] Route to a barebones QR code login page

Summary:
While the QR code work is in progress, we don't want it to be the first login page displayed. Instead, we're hiding it behind a 'login via QR code button' as done earlier in the stack.

The context is in ENG-4585, but the basics for this diff are:

  • Update NavInfo to include a loginMethod: form | qr-code
  • Update URLInfo to include a qrCode?: boolean prop
  • Add the RegEx statement alongside the other url regex statements to match for qr-code in the URL
  • In web/url-utils.js, we should do two things:
    • in canonicalURLFromReduxState: append 'qr-code' to the url if the user is not logged in and navInfo.loginMethod === 'qr-code'
    • in navInfoFromURL: if urlInfo.qrCode === true, we want to set newNavInfo.loginMethod === 'qr-code', otherwise we set it to 'form'
  • Lastly, in web/app.react.js, instead of just rendering Splash when the user is not logged in, we look at the navInfo and decide whether to render Splash or the new page that will display the QR code (this logic is pretty similar to what is done for renderMainContent()

Mainly followed by the settings stack (D3342) for inspiration on writing this code

Depends on D8811

Test Plan:
Confirmed the following:

  1. The main login page is still the form
  2. Clicking the 'login via qr code button' navigates to the new barebones page and the url updates

(I reload the page first to show that the form is still rendered by default, then click the button to render what will be the QR code page)

Reviewers: atul, ginsu, tomek, varun

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D8818

Details

Provenance
rohanAuthored on Aug 15 2023, 12:02 PM
Reviewer
tomek
Differential Revision
D8818: [lib/web] Route to a barebones QR code login page
Parents
rCOMM7f2251d085b3: [web] Add a temporary login via QR code button on the log-in form
Branches
Unknown
Tags
Unknown