Commit 76873ce4 authored by Robert Speicher's avatar Robert Speicher

Move "invalid 2FA code" error message to the flash

This makes it consistent with the Invalid email/password error message
from the previous step.
parent 3fb0fedd
...@@ -63,7 +63,7 @@ class SessionsController < Devise::SessionsController ...@@ -63,7 +63,7 @@ class SessionsController < Devise::SessionsController
sign_in(user) sign_in(user)
else else
@error = 'Invalid two-factor code' flash.now[:alert] = 'Invalid two-factor code.'
render :two_factor and return render :two_factor and return
end end
else else
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
%h3 Two-factor Authentication %h3 Two-factor Authentication
.login-body .login-body
= form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f| = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f|
- if @error
.alert.alert-danger
= @error
= f.text_field :otp_attempt, class: 'form-control', placeholder: 'Two-factor authentication code', required: true, autofocus: true = f.text_field :otp_attempt, class: 'form-control', placeholder: 'Two-factor authentication code', required: true, autofocus: true
%p.help-block.hint If you've lost your phone, you may enter one of your recovery codes. %p.help-block.hint If you've lost your phone, you may enter one of your recovery codes.
.prepend-top-20 .prepend-top-20
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment