From 5b81724c01bf839b9e5a34534f446fbe81c77a3b Mon Sep 17 00:00:00 2001 From: Gaurish Sharma Date: Mon, 7 Nov 2016 19:50:56 +0530 Subject: [PATCH] Stop hardcoding User, use generic resource User can also be called Admin. so use generic "resource" same way devise uses. --- app/views/devise/two_factor_authentication/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/devise/two_factor_authentication/show.html.erb b/app/views/devise/two_factor_authentication/show.html.erb index a914421..552fd7d 100644 --- a/app/views/devise/two_factor_authentication/show.html.erb +++ b/app/views/devise/two_factor_authentication/show.html.erb @@ -1,4 +1,4 @@ -<% if current_user.direct_otp %> +<% if resource.direct_otp %>

Enter the code that was sent to you

<% else %>

Enter the code from your authenticator app

@@ -11,7 +11,7 @@ <%= submit_tag "Submit" %> <% end %> -<% if current_user.direct_otp %> +<% if resource.direct_otp %> <%= link_to "Resend Code", resend_code_user_two_factor_authentication_path, action: :get %> <% else %> <%= link_to "Send me a code instead", resend_code_user_two_factor_authentication_path, action: :get %>