X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2Fapi%2FApiLogin.php;h=0e4c6e0c84345aba9cf3d71c2dd913efeb8d90c5;hb=fda4d48e843a8a0b49faa013818af94180e8148e;hp=1dadc0721a16231095f6d166f718cd6f791edf4d;hpb=23e5cdb5034dca5bbdfc2ac9c111c5fac20ff579;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index 1dadc0721a..0e4c6e0c84 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -212,6 +212,15 @@ class ApiLogin extends ApiBase { $result['lguserid'] = intval( $user->getId() ); $result['lgusername'] = $user->getName(); + + // @todo: These are deprecated, and should be removed at some + // point (1.28 at the earliest, and see T121527). They were ok + // when the core cookie-based login was the only thing, but + // CentralAuth broke that a while back and + // SessionManager/AuthManager *really* break it. + $result['lgtoken'] = $user->getToken(); + $result['cookieprefix'] = $this->getConfig()->get( 'CookiePrefix' ); + $result['sessionid'] = $session->getId(); break; case 'NeedToken': @@ -219,6 +228,10 @@ class ApiLogin extends ApiBase { $this->setWarning( 'Fetching a token via action=login is deprecated. ' . 'Use action=query&meta=tokens&type=login instead.' ); $this->logFeatureUsage( 'action=login&!lgtoken' ); + + // @todo: See above about deprecation + $result['cookieprefix'] = $this->getConfig()->get( 'CookiePrefix' ); + $result['sessionid'] = $session->getId(); break; case 'WrongToken':