You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# path: lib/tasks/devise.rakenamespace:devisedodesc"Send password reset instructions to all users (but does not actually reset passwords)"tasksend_password_reset_instructions: :environmentdoUser.find_eachdo |user|
# This only sends the password reset instructions, the# password is not changed. (Recipient has to click link# in email and follow instructions to actually change# the password).user.send_reset_password_instructionsendend# DANGER! This locks out all users. You probably only want this when all passwords have been compromised.desc"DANGER: Resets all passwords AND then sends password reset instructions to all users. This will lockout all users until they reset their password."taskreset_and_send_password_reset_instructions: :environmentdoUser.find_eachdo |user|
# Generate random, long password that the user will never know:new_password=Devise.friendly_token(50)user.reset_password(new_password,new_password)# Send instructions so user can enter a new password:user.send_reset_password_instructionsendendend