Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCS correctly handle login exception #522

Merged
merged 2 commits into from
Jul 22, 2016
Merged

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Jul 22, 2016

Missed case

Basically when a login exception is thrown (bad token/password/disabled user) we should repond with the proper OCS code.

CC: @LukasReschke

@rullzer rullzer added the 3. to review Waiting for reviews label Jul 22, 2016
@rullzer rullzer added this to the Nextcloud 11.0 milestone Jul 22, 2016
@mention-bot
Copy link

@rullzer, thanks for your PR! By analyzing the annotation information on this pull request, we identified @SergioBertolinSG, @DeepDiver1975 and @PVince81 to be potential reviewers

@icewind1991
Copy link
Member

👍

@@ -85,6 +85,8 @@
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'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class OC_OCS_Result has been deprecated with message: Since 9.1.0 use \OC\OCS\Result

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know but old obsolete api OC_API.
So I can't pass in \OC\OCS\Result

@rullzer rullzer force-pushed the ocs_correct_login_exception branch from f623e3d to 67ce87d Compare July 22, 2016 11:37
@MorrisJobke
Copy link
Member

👍

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jul 22, 2016
@rullzer rullzer merged commit 1533780 into master Jul 22, 2016
@rullzer rullzer deleted the ocs_correct_login_exception branch July 22, 2016 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants