
18

there aught to be a law against you coming around
source link: https://technomancy.us/20
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

# failed login flash.now[: attempts] = @params[: attempts].to_i + 1 if flash[: attempts] > 3 flash.now[: error] = 'You seem to be having trouble logging in. If you want your password reset, simply try to log in with the password "forgot'" elsif @params[: user][: password].include?('forgot') User.find_by_email(@params[: email]).reset_password flash.now[: notice] = 'Your password has been reset an emailed to you.' else flash.now[: error] = 'You provided an incorrect email and password combination.' end
More people should do this. It one thing I haven't seen anywhere else and one thing that is more rare than it should be. First of all, it will reset your password and email it to you if you enter 'forgot' in the password box. Secondly, it suggests that you get your password reset if you try to log in with the wrong password too many times. Simple things, but they're worth paying attention to.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK