Use useformat query param for device detection or mobile domain (m.)
Instead of passing mobile=1 URL param around in both PHP & JS code,
make use of the standard useformat=mobile|desktop query param in the
URL for device detection. If we're on a mobile domain already like WMF
configures, we will just use that but if we're not on a mobile (m.)
domain, we'll use the useformat query parameter.
In combination with onAuthPreserveQueryParams hook, we can preserve the
useformat query parameter and pass it around in the URLs. The result
of this is that we keep the device experience in sync when performing
the authentication workflow (when not already on a m. domains).
Test plan
- Visit a local wiki (on mobile view - toggle view to mobile)
- Click the "Login" link and fill the form presented
- Authentication succeeds and you're still on the mobile view
Tgr's test plan
For each domain and its mobile version (m.) (a wiki where the CentralAuth
cookie domain is the parent domain and one where it is itself):
- log in
- check edge login (ie. log in somewhere else, check you are logged in on that wiki)
- check autologin (delete all local cookies, reload, check you are logged in)
- check top-level autologin (set CentralAuthAnon cookie, click login link)
Also notice that in the "Login" page, the useformat=mobile should be
present in the URL as a query parameter in SUL2 mode.
Bug: T380646
Bug: T375788
Change-Id: Ida6307f941907498d6d06e390816a8d63acb2c5d
(cherry picked from commit e612547be58e97002f09e60b2b353b9631858365)