OCS API should catch LoginExceptions
Catching the login exception and returning false (login failed). Makes the OCS API properly return data instead of printing the exception page.
This commit is contained in:
parent
271ba6da63
commit
9b875db8b8
1 changed files with 5 additions and 1 deletions
|
@ -356,7 +356,11 @@ class OC_API {
|
|||
if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) ) {
|
||||
$authUser = $_SERVER['PHP_AUTH_USER'];
|
||||
$authPw = $_SERVER['PHP_AUTH_PW'];
|
||||
$return = OC_User::login($authUser, $authPw);
|
||||
try {
|
||||
$return = OC_User::login($authUser, $authPw);
|
||||
} catch (\OC\User\LoginException $e) {
|
||||
return false;
|
||||
}
|
||||
if ($return === true) {
|
||||
self::$logoutRequired = true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue