not idiomatic for controller actions to call each other; fix username field
This commit is contained in:
parent
8f0a2007c6
commit
69dfe95d64
|
@ -29,6 +29,7 @@ class LoginController < ApplicationController
|
|||
end
|
||||
|
||||
def login
|
||||
@title = "Login"
|
||||
user = if /@/.match?(params[:email].to_s)
|
||||
User.where(email: params[:email]).first
|
||||
else
|
||||
|
@ -100,7 +101,7 @@ class LoginController < ApplicationController
|
|||
|
||||
flash.now[:error] = fail_reason
|
||||
@referer = params[:referer]
|
||||
index
|
||||
render "index"
|
||||
end
|
||||
|
||||
def forgot_password
|
||||
|
@ -131,7 +132,7 @@ class LoginController < ApplicationController
|
|||
@found_user.initiate_password_reset_for_ip(request.remote_ip)
|
||||
|
||||
flash.now[:success] = "Password reset instructions have been e-mailed to you."
|
||||
index
|
||||
render "index"
|
||||
end
|
||||
|
||||
def set_new_password
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<%= form_with url: login_path do |form| %>
|
||||
<p>
|
||||
<%= form.label :email, "E-mail or Username:" %>
|
||||
<%= form.email_field :email, :size => 40, :inputmode => "email", :autofocus => "autofocus" %>
|
||||
<%= form.text_field :email, :size => 40, :inputmode => "email", :autofocus => "autofocus" %>
|
||||
<br />
|
||||
|
||||
<%= form.label :password, "Password:" %>
|
||||
|
|
Loading…
Reference in New Issue