1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Remove support for the "TYPE_AUTH_WILLLOGIN" event

Summary:
Depends on D19903. Ref T13222. This was a Facebook-specific thing from D6202 that I believe no other install ever used, and I'm generally trying to move away from the old "event" system (the more modern modular/engine patterns generally replace it).

Just drop support for this. Since the constant is being removed, anything that's actually using it should break in an obvious way, and I'll note this in the changelog.

There's no explicit replacement but I don't think this hook is useful for anything except "being Facebook in 2013".

Test Plan:
  - Grepped for `TYPE_AUTH_WILLLOGIN`.
  - Logged in.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13222

Differential Revision: https://secure.phabricator.com/D19904
This commit is contained in:
epriestley 2018-12-18 11:31:45 -08:00
parent ff49d1ef77
commit 38c48ae7d0
2 changed files with 21 additions and 37 deletions

View file

@ -55,20 +55,6 @@ abstract class PhabricatorAuthController extends PhabricatorController {
$response = $this->buildLoginValidateResponse($user); $response = $this->buildLoginValidateResponse($user);
$session_type = PhabricatorAuthSession::TYPE_WEB; $session_type = PhabricatorAuthSession::TYPE_WEB;
$event_type = PhabricatorEventType::TYPE_AUTH_WILLLOGINUSER;
$event_data = array(
'user' => $user,
'type' => $session_type,
'response' => $response,
'shouldLogin' => true,
);
$event = id(new PhabricatorEvent($event_type, $event_data))
->setUser($user);
PhutilEventEngine::dispatchEvent($event);
$should_login = $event->getValue('shouldLogin');
if ($should_login) {
if ($force_full_session) { if ($force_full_session) {
$partial_session = false; $partial_session = false;
} else { } else {
@ -90,9 +76,8 @@ abstract class PhabricatorAuthController extends PhabricatorController {
$session_key); $session_key);
$this->clearRegistrationCookies(); $this->clearRegistrationCookies();
}
return $event->getValue('response'); return $response;
} }
protected function clearRegistrationCookies() { protected function clearRegistrationCookies() {

View file

@ -22,7 +22,6 @@ final class PhabricatorEventType extends PhutilEventType {
const TYPE_PEOPLE_DIDRENDERMENU = 'people.didRenderMenu'; const TYPE_PEOPLE_DIDRENDERMENU = 'people.didRenderMenu';
const TYPE_AUTH_WILLREGISTERUSER = 'auth.willRegisterUser'; const TYPE_AUTH_WILLREGISTERUSER = 'auth.willRegisterUser';
const TYPE_AUTH_WILLLOGINUSER = 'auth.willLoginUser';
const TYPE_AUTH_DIDVERIFYEMAIL = 'auth.didVerifyEmail'; const TYPE_AUTH_DIDVERIFYEMAIL = 'auth.didVerifyEmail';
} }