discourse/spec/lib/validators
Alan Guo Xiang Tan e97ef7e9af
FEATURE: Allow site admin to mark a user's password as expired (#27314)
This commit adds the ability for site administrators to mark users'
passwords as expired. Note that this commit does not add any client side
interface to mark a user's password as expired.

The following changes are introduced in this commit:

1. Adds a `user_passwords` table and `UserPassword` model. While the
   `user_passwords` table is currently used to only store expired
   passwords, it will be used in the future to store a user's current
   password as well.

2. Adds a `UserPasswordExpirer.expire_user_password` method which can
   be used from the Rails console to mark a user's password as expired.

3. Updates `SessionsController#create` to check that the user's current
   password has not been marked as expired after confirming the
   password. If the password is determined to be expired based on the
   existence of a `UserPassword` record with the `password_expired_at`
   column set, we will not log the user in and will display a password
   expired notice. A forgot password email is automatically send out to
   the user as well.
2024-06-04 15:42:53 +08:00
..
allowed_ip_address_validator_spec.rb DEV: Remove unreachable IP address validation message (#24131) 2023-10-27 15:22:38 +08:00
at_least_one_group_validator_spec.rb DEV: Validate that passed in groups exist in AtLeastOneGroupValidator (#24890) 2023-12-14 10:00:53 +08:00
category_search_priority_weights_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
censored_words_validator_spec.rb DEV: Refactor watched words (#24163) 2023-11-01 16:41:10 +02:00
css_color_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
delete_rejected_email_after_days_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
email_address_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
email_setting_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
email_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
enable_local_logins_via_email_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
enable_sso_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
external_system_avatars_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
form_template_yaml_validator_spec.rb DEV: Remove unnecessary rails_helper requiring (#26364) 2024-03-26 11:32:01 +01:00
group_setting_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
host_list_setting_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
integer_setting_validator_spec.rb UX: number site setting validation message (#24303) 2023-11-10 14:27:35 +11:00
ip_address_format_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
linkedin_oidc_credentials_validator_spec.rb FEATURE: Allow users to sign in using LinkedIn OpenID Connect (#26281) 2024-04-19 18:47:30 +08:00
max_emojis_validator_spec.rb FIX: Use only first character when looking up emoji (#22977) 2023-08-04 15:28:58 +02:00
max_username_length_validator_spec.rb DEV: Add some description to help with understanding flakey test failures (#22772) 2023-07-25 15:14:08 +08:00
min_username_length_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
password_validator_spec.rb FEATURE: Allow site admin to mark a user's password as expired (#27314) 2024-06-04 15:42:53 +08:00
post_validator_spec.rb PERF: bail out of expensive post validations 2024-05-07 18:56:16 +02:00
quality_title_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
regex_presence_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
regex_setting_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
regexp_list_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
reply_by_email_address_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
reply_by_email_enabled_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
search_ranking_weights_validator_spec.rb DEV: Correct syntax_tree violations 2023-02-02 13:03:11 +00:00
search_tokenize_chinese_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
search_tokenize_japanese_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
selectable_avatars_mode_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
sso_overrides_email_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
string_setting_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
timezone_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
topic_title_length_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00
unicode_username_allowlist_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
unicode_username_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
upload_validator_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
url_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
user_full_name_validator_spec.rb DEV: Update the rubocop-discourse gem 2023-06-26 11:41:52 +02:00
username_setting_validator_spec.rb DEV: Apply syntax_tree formatting to spec/* 2023-01-09 11:49:28 +00:00