Allow basic auth for API requests only

refs #11151
This commit is contained in:
Alexander A. Klimov 2016-02-15 10:53:32 +01:00
parent dc9cfc1c81
commit a464e74aa4
1 changed files with 2 additions and 2 deletions

View File

@ -270,7 +270,7 @@ class Auth
} }
/** /**
* Attempt to authenticate a user using HTTP authentication * Attempt to authenticate a user using HTTP authentication on API requests only
* *
* Supports only the Basic HTTP authentication scheme. XHR will be ignored. * Supports only the Basic HTTP authentication scheme. XHR will be ignored.
* *
@ -279,7 +279,7 @@ class Auth
protected function authHttp() protected function authHttp()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
if ($request->isXmlHttpRequest()) { if ($request->isXmlHttpRequest() || ! $request->isApiRequest()) {
return false; return false;
} }
if (($header = $request->getHeader('Authorization')) === false) { if (($header = $request->getHeader('Authorization')) === false) {