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.
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T122654 Flow shows "you are not logged in" even though I'm logged in | |||
Open | Feature | None | T122655 CentralAuth Autologin should emit an event after logging in the user, for other components to listen to |
Event Timeline
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:
- 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:
- They are successfully logged in, but it just shows a notification.
I think we need a hook that is fired in both success cases.
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).