strengthCheck method wraps the Strength Check Password API endpoint. This method allows you to check whether or not the user’s provided password is valid based on the configuration set in your Stytch Dashboard, and to provide feedback to the user on how to increase the strength of their password. All passwords must pass the strength requirements to be accepted as valid.
Parameters
The password for the user. Any UTF8 character is allowed, e.g. spaces, emojis, non-English characters, etc.
The email associated with the password. If the email address is included, it will be factored into strength evaluation via our password breach checks. If you do not include the email, it is possible that the strength check response will evaluate as valid – but the password will fail with a weak_password error when used in the Create password endpoint due to a breach check failure.
Response
Will return true if breach detection will be evaluated. By default this option is enabled. This option can be disabled in the dashboard. If this value is false then
breached_password will always be false as well.Returns true if the password has been breached. Powered by HaveIBeenPwned.
The score of the password determined by zxcvbn. Values will be between 1 and 4, a 3 or greater is required to pass validation.
The strength policy type enforced, either
zxcvbn or luds.Returns true if the password passes our password validation. We offer two validation options, zxcvbn is the default option which offers a high level of sophistication. We also offer LUDS which is less sophisticated but easier to understand. If an email address is included in the call we also require that the password hasn’t been compromised using built-in breach detection powered by HaveIBeenPwned.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we
may ask for this value to help identify a specific API call when helping you debug an issue.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values
equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.