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

WIP: Self registration tests #6198

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

JeffersonBledsoe
Copy link
Member

No description provided.

Copy link

netlify bot commented Jul 26, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 238fb56
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66a2fb66c99b7e000883318b

@JeffersonBledsoe
Copy link
Member Author

@davisagli I'm trying to add a test to reflect the changes in #5935, but I'm getting the following error from the backend:

{
  "error": {
    "errors": [
      {
        "field": "sendPasswordReset",
        "message": "Property 'Send a confirmation mail with a link to set the password' is not allowed."
      }
    ],
    "message": "Error in fields. Property 'Send a confirmation mail with a link to set the password' is not allowed.",
    "type": "WrongParameterError"
  }
}

This is with the following request:

POST http://127.0.0.1:55001/plone/++api++/@users {"fullname":"Placeholder name","email":"[email protected]","sendPasswordReset":true}. Toggling Let users select their own passwords doesn't help. Any suggestions as to why this might be failing?

@davisagli
Copy link
Sponsor Member

@JeffersonBledsoe Currently sendPasswordReset is only allowed in the REST API if the current user has permission to manage users. (https://github.com/plone/plone.restapi/blob/main/src/plone/restapi/services/users/add.py#L75)

I don't see a reason to restrict it in that way. It should be possible to request a password reset email regardless of whether the user is being added by an admin or self-registering. I'd accept a PR to plone.restapi to make that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants