aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Douma <rullzer@users.noreply.github.com>2016-07-22 14:47:53 +0200
committerGitHub <noreply@github.com>2016-07-22 14:47:53 +0200
commit1533780dde9e27fd3670ee2d631ea4ebb54ccb28 (patch)
treedececbe2da3fc27a504d7e69db552ffeeb8e13b4
parent194c385c7a3200ca939f4ee85c3230cdb869f98e (diff)
parent67ce87dca718bb45764e85aaec58aa803b645154 (diff)
downloadnextcloud-server-1533780dde9e27fd3670ee2d631ea4ebb54ccb28.tar.gz
nextcloud-server-1533780dde9e27fd3670ee2d631ea4ebb54ccb28.zip
Merge pull request #522 from nextcloud/ocs_correct_login_exception
OCS correctly handle login exception
-rw-r--r--build/integration/features/provisioning-v1.feature4
-rw-r--r--ocs/v1.php2
2 files changed, 4 insertions, 2 deletions
diff --git a/build/integration/features/provisioning-v1.feature b/build/integration/features/provisioning-v1.feature
index 135c67dc3a6..487e025092b 100644
--- a/build/integration/features/provisioning-v1.feature
+++ b/build/integration/features/provisioning-v1.feature
@@ -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"
diff --git a/ocs/v1.php b/ocs/v1.php
index 0ea3ac4c766..575b509b012 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -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();