From de9e1c3bad18e4ca00cfdced75e5cc4c42905761 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 31 Mar 2015 04:19:01 +0300 Subject: Turn 2-factor authentication into 2 steps process. Disabled 2fa UI for ldap users since it is not supported --- app/views/devise/sessions/_new_base.html.haml | 4 ++-- app/views/devise/sessions/two_factor.html.haml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/views/devise/sessions/two_factor.html.haml (limited to 'app/views/devise') diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 4ecb74fb56e..dcb989e8d81 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -1,7 +1,7 @@ = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| = f.text_field :login, class: "form-control top", placeholder: "Username or Email", autofocus: "autofocus" - = f.password_field :password, class: "form-control middle", placeholder: "Password" - = f.text_field :otp_attempt, class: 'form-control bottom', placeholder: 'Two-factor authentication token' + = f.password_field :password, class: "form-control bottom", placeholder: "Password" + = f.hidden_field :otp_attempt, value: '' - if devise_mapping.rememberable? .remember-me.checkbox %label{for: "user_remember_me"} diff --git a/app/views/devise/sessions/two_factor.html.haml b/app/views/devise/sessions/two_factor.html.haml new file mode 100644 index 00000000000..3a19e926b6d --- /dev/null +++ b/app/views/devise/sessions/two_factor.html.haml @@ -0,0 +1,16 @@ +%div + .login-box + .login-heading + %h3 Two-Factor Authentication + .login-body + = form_for(resource, as: resource_name, url: session_path(resource_name), method: :post) do |f| + - if @error + .alert.alert-danger + = @error + .hide + = f.text_field :login, class: "form-control top", placeholder: "Username or Email", autofocus: "autofocus" + = f.password_field :password, class: "form-control bottom", placeholder: "Password" + = f.text_field :otp_attempt, class: 'form-control', + placeholder: 'Two-factor authentication token', required: true, autofocus: true + .prepend-top-20 + = f.submit "Verify code", class: "btn btn-save" -- cgit v1.2.1