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

feat(core): Expose the confirm password endpoint #43668

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

provokateurin
Copy link
Member

Second try of #43000

Summary

This allows non-web clients to confirm the password in order to use endpoints that require it.

Checklist

Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin
Copy link
Member Author

Ah of course this stills needs the frontend changes to work with the new endpoint.

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

Fine by me, but I would prefer to add/duplicate it into https://github.com/nextcloud/server/blob/master/core/Controller/AppPasswordController.php to have it available as proper OCS API

@nickvergessen
Copy link
Member

Ah of course this stills needs the frontend changes to work with the new endpoint.

Currently this is non breaking and nothing needs changes? Or am I missing something?

Copy link
Member

@bigcat88 bigcat88 left a comment

Choose a reason for hiding this comment

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

The only change is adding NoCSRFRequired - right?

@provokateurin
Copy link
Member Author

You're both right, I thought I had converted it to OCS which is not true 😅

core/Controller/AppPasswordController.php Outdated Show resolved Hide resolved
#[UseSession]
public function confirmUserPassword(string $password): DataResponse {
$loginName = $this->userSession->getLoginName();
$loginResult = $this->userManager->checkPassword($loginName, $password);

Check notice

Code scanning / Psalm

PossiblyNullArgument Note

Argument 1 of OCP\IUserManager::checkPassword cannot be null, possibly null value provided
@provokateurin provokateurin force-pushed the feat/core/expose-confirm-password-endpoint branch from e4de634 to 8f91df8 Compare February 20, 2024 08:40
Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin provokateurin force-pushed the feat/core/expose-confirm-password-endpoint branch from 8f91df8 to 6243a94 Compare February 20, 2024 13:28
@provokateurin provokateurin merged commit 19bff05 into master Feb 20, 2024
159 checks passed
@provokateurin provokateurin deleted the feat/core/expose-confirm-password-endpoint branch February 20, 2024 14:56
@blizzz blizzz mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants