Strip whitespace from email when logging in

Makes it a little easier to copy-paste credentials
This commit is contained in:
Justin Collins
2020-03-25 11:22:20 -07:00
parent 70d41440c4
commit 6acf74aa35
+1 -1
View File
@@ -12,7 +12,7 @@ class SessionsController < ApplicationController
path = params[:url].present? ? params[:url] : home_dashboard_index_path
begin
# Normalize the email address, why not
user = User.authenticate(params[:email].to_s.downcase, params[:password])
user = User.authenticate(params[:email].to_s.strip.downcase, params[:password])
rescue RuntimeError => e
# don't do ANYTHING
end