Revert breaking change in Auth::isAuthenticated()
refs #12580 fixes #13281
This commit is contained in:
parent
f1051f0ea5
commit
4eb61c2bcf
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue