Page MenuHomePhabricator

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

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 created this task.Dec 30 2015, 3:38 PM
TheDJ raised the priority of this task from to Needs Triage.
TheDJ updated the task description. (Show Details)
TheDJ added a subscriber: TheDJ.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 30 2015, 3:38 PM
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 ?

TheDJ added a comment.Dec 31 2015, 5:42 PM

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.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptOct 28 2016, 9:47 PM