login_password_requirements_base.rdoc

doc/login_password_requirements_base.rdoc
Last Update: 2024-11-16 18:49:45 -0800

Documentation for Login Password Requirements Base Feature

The login password requirements base feature is automatically loaded when you use a Rodauth feature that requires setting logins or passwords.

Auth Value Methods

already_an_account_with_this_login_message

The error message to display when there already exists an account with the same login.

contains_null_byte_message

The error message to display when the password contains a null byte (only used if parameters with null bytes are otherwise allowed).

login_confirm_label

The label to use for login confirmations.

login_confirm_param

The parameter name to use for login confirmations.

login_does_not_meet_requirements_message

The error message to display when the login does not meet the requirements you have set.

login_email_regexp

The regular expression used to validate whether login is a valid email address.

login_maximum_bytes

The maximum length for logins in bytes, 255 by default.

login_maximum_length

The maximum length for logins in characters, 255 by default.

login_minimum_length

The minimum length for logins in characters, 3 by default.

login_not_valid_email_message

The error message to display when login is not a valid email address.

login_too_long_message

The error message fragment to show if the login is too long.

login_too_many_bytes_message

The error message fragment to show if the login has too many bytes.

login_too_short_message

The error message fragment to show if the login is too short.

logins_do_not_match_message

The error message to display when login and login confirmation do not match.

password_confirm_label

The label to use for password confirmations.

password_confirm_param

The parameter name to use for password confirmations.

password_does_not_meet_requirements_message

The error message to display when the password does not meet the requirements you have set.

password_hash_cost

The cost to use for the password hash algorithm. This should be an integer when using bcrypt (the default), and a hash if using argon2 (supported by the argon2 feature).

password_maximum_bytes

The maximum length for passwords in bytes, nil by default for no limit. bcrypt only uses the first 72 bytes of the password when creating the password hash, so if you are using bcrypt as the password hash function, you may want to set this to 72.

password_maximum_length

The maximum length for passwords in characters, nil by default for no limit.

password_minimum_length

The minimum length for passwords in characters, 6 by default.

password_too_long_message

The error message fragment to show if the password is too long.

password_too_many_bytes_message

The error message fragment to show if the password is has too many bytes.

password_too_short_message

The error message fragment to show if the password is too short.

passwords_do_not_match_message

The error message to display when password and password confirmation do not match.

require_email_address_logins?

Whether logins need to be valid email addresses, true by default.

require_login_confirmation?

Whether login confirmations are required when changing logins or creating accounts. True by default if not verifying the account.

require_password_confirmation?

Whether password confirmations are required when changing/resetting passwords and creating accounts.

same_as_existing_password_message

The error message to display when a new password is the same as the existing password.

Auth Methods

login_confirmation_matches?(login, login_confirmation)

Whether the login matches the login confirmation, does a case insensitive check using casecmp by default.

login_meets_requirements?(login)

Whether the given login meets the requirements. By default, just checks that the login is a valid email address.

login_valid_email?(login)

Whether the login is a valid email address.

password_hash(password)

A hash of the given password.

password_meets_requirements?(password)

Whether the given password meets the requirements. Can be used to implement complexity requirements for passwords.

set_password(password)

Set the password for the current account to the given password.