Page MenuHomePhabricator

CentralAuth Autologin should emit an event after logging in the user, for other components to listen to
Open, Needs TriagePublicFeature

Description

It would be wise if autologin triggered an event that other JS based tools can listen to. This could help avoid tools from informing the user that he is not logged in, even though this just happened automagically and the personal tools reflect that the user is logged in.

Event Timeline

TheDJ raised the priority of this task from to Needs Triage.
TheDJ updated the task description. (Show Details)
TheDJ subscribed.
Mattflaschen-WMF renamed this task from CentralAuth Autologin should emit an event after loggin in the user, for other components to listen to to CentralAuth Autologin should emit an event after logging in the user, for other components to listen to.Dec 31 2015, 3:31 AM
Mattflaschen-WMF set Security to None.

mw.hook may be a good candidate for this, since it should only happen once per page load.

I agree this might be a good candidate for an mw.hook. We could call it ... user.login ?

Actual.. maybe we already have one:
mw.hook( 'centralauth-p-personal-reset' ).fire();
in modules/inline/autologin.js

It looks like there are two success cases:

  1. HTML is returned to replace the #p-personal list with. centralauth-p-personal-reset is fired in this case (this is useful in its own right, so e.g. user scripts that customize personal tools can act).

Or:

  1. They are successfully logged in, but it just shows a notification.

I think we need a hook that is fired in both success cases.

I changed the subtype of this task from "Task" to "Feature Request".Feb 27 2023, 11:06 AM

IMO this is not worth doing, updating all potentially affected UI is infeasible (might have a different skin etc), not to mention all the server-side generated login notices (e.g. when visiting a registered-user-only special page). And updating a subset of affected UIs would just be confusing. We should get rid of the personal bar reset thing, and always tell the user to reload (and probably tell it in a more sticky manner - maybe something like the temp user top bar).