зеркало из https://github.com/nextcloud/server.git
Merge pull request #522 from nextcloud/ocs_correct_login_exception
OCS correctly handle login exception
This commit is contained in:
Коммит
1533780dde
|
@ -508,6 +508,6 @@ Feature: provisioning
|
|||
And assure user "user0" is disabled
|
||||
And As an "user0"
|
||||
When sending "GET" to "/index.php/apps/files"
|
||||
Then the OCS status code should be "999"
|
||||
And the HTTP status code should be "200"
|
||||
Then the OCS status code should be "997"
|
||||
And the HTTP status code should be "401"
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ try {
|
|||
OC_Response::setStatus(405);
|
||||
} catch (\OC\OCS\Exception $ex) {
|
||||
OC_API::respond($ex->getResult(), OC_API::requestedFormat());
|
||||
} catch (\OC\User\LoginException $e) {
|
||||
OC_API::respond(new OC_OCS_Result(null, \OCP\API::RESPOND_UNAUTHORISED, 'Unauthorised'));
|
||||
} catch (\Exception $e) {
|
||||
OC_API::setContentType();
|
||||
OC_OCS::notFound();
|
||||
|
|
Загрузка…
Ссылка в новой задаче