Revert breaking change in Auth::isAuthenticated()

refs #12580
fixes #13281
This commit is contained in:
Eric Lippmann 2016-12-06 12:41:22 +01:00
parent f1051f0ea5
commit 4eb61c2bcf
2 changed files with 8 additions and 18 deletions

View File

@ -416,7 +416,6 @@ class Web extends EmbeddedWeb
private function setupUser()
{
$auth = Auth::getInstance();
$auth->authenticate();
if (! $this->request->isXmlHttpRequest() && $this->request->isApiRequest() && ! $auth->isAuthenticated()) {
$auth->authHttp();
}

View File

@ -78,22 +78,6 @@ class Auth
return new AuthChain();
}
/**
* Authenticate the user
*
* @return bool
*/
public function authenticate()
{
if ($this->user === null) {
$this->authenticateFromSession();
}
if ($this->user === null && ! $this->authExternal()) {
return false;
}
return true;
}
/**
* Get whether the user is authenticated
*
@ -101,7 +85,14 @@ class Auth
*/
public function isAuthenticated()
{
return $this->user !== null;
if ($this->user !== null) {
return true;
}
$this->authenticateFromSession();
if ($this->user === null && ! $this->authExternal()) {
return false;
}
return true;
}
public function setAuthenticated(User $user, $persist = true)