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

Configurable password policy #863

Closed
michaelbromley opened this issue May 5, 2021 · 0 comments
Closed

Configurable password policy #863

michaelbromley opened this issue May 5, 2021 · 0 comments

Comments

@michaelbromley
Copy link
Member

Is your feature request related to a problem? Please describe.
When using native auth, there is no server-side check on the password. So extremely weak passwords like "1" would be accepted when registering a customer account. While the storefront application can enforce some stronger policy, we should also be able to enforce it at the server level too.

Describe the solution you'd like
A new config option:

authOptions: {
  passwordPolicy: (password: string) => boolean | string;
}

This allows a custom function to be defined which can enforce min length and any other character-related requirements desired. Returning true allows the registration to proceed. Returning false or a string will prevent the operation and return an ErrorResult with any message returned by the function (or a generic one).

michaelbromley added a commit that referenced this issue Feb 16, 2022
Closes #863. The default policy is intentionally permissive to reduce the risk of
backward-compatibility breaks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant