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

Registration - Username validation not working #5496

Closed
kulbon opened this issue Mar 12, 2020 · 2 comments
Closed

Registration - Username validation not working #5496

kulbon opened this issue Mar 12, 2020 · 2 comments
Labels
good first issue Good for newcomers issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: plugin:users-permissions Source is plugin/users-permissions package status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@kulbon
Copy link

kulbon commented Mar 12, 2020

Describe the bug
Ability to register new account on frontend with empty username. Username validation is not working.

extensions/users-permissions/models/users.settings.json

"attributes": {
    "username": {
      "type": "string",
      "minLength": 3,
      "unique": true,
      "configurable": false,
      "required": true
    },

Steps to reproduce the behavior

await axios.post(`${process.env.REACT_APP_STRAPI_URL}/auth/local/register`, {
      email: email,
      password: password,
      confirmPassword: confirmPassword,
      username: username
    });

Screenshots
screen1

System

@lauriejim lauriejim added severity: medium If it breaks the basic use of the product but can be worked around source: plugin:users-permissions Source is plugin/users-permissions package status: confirmed Confirmed by a Strapi Team member or multiple community members issue: bug Issue reporting a bug good first issue Good for newcomers labels Mar 18, 2020
@lauriejim
Copy link
Contributor

Thank you for reporting this issue.
This will help us if you can investigate this issue and provide a PR to fix it.
Thank you.

@kbariotis
Copy link

@kulbon adding a custom user.settings.json shouldn't be needed in this case as the users-permissions plugin has the username field required by default.

But I cannot see where this file is being loaded. @lauriejim would you be able to guide me in the codebase a little bit regarding this? I would love to help.

I've found where these .settings.json files are being generated but now where are being loaded. Validation for the users-permissions happens in the controller directly atm. Are these .settings.json files being loaded at all or is it possible that this functionality is not implemented yet?

@strapi strapi locked as resolved and limited conversation to collaborators Jun 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: plugin:users-permissions Source is plugin/users-permissions package status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
None yet
Development

No branches or pull requests

3 participants