From a8f976dfc3dd81aea68b97eaae5e02a1c6ed1325 Mon Sep 17 00:00:00 2001 From: Gabriel Rambert Date: Fri, 28 Oct 2016 12:17:12 -0400 Subject: [PATCH 1/2] Update README.md I struggled getting this gem working until I realized that I had to use the github repo as my gem src. So I updated the README.md file accordingly. Please modify it as you see fit. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dabdea41..2a4e798e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,11 @@ ### Initial Setup -In a Rails environment, require the gem in your Gemfile: +For Rails 5+ require the gem file and point the src to this github repo: + + gem 'two_factor_authentication', github: "Houdini/two_factor_authentication" + +In other Rails environments, require the gem in your Gemfile: gem 'two_factor_authentication' From e7490628baccc0d12a131c7ce9b2dc5bc8313c4b Mon Sep 17 00:00:00 2001 From: Gabriel Rambert Date: Fri, 28 Oct 2016 15:27:16 -0400 Subject: [PATCH 2/2] Trying to get the gem to call send_two_factor_authentication_code method --- .../hooks/two_factor_authenticatable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb b/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb index 159ae144..e854e29b 100644 --- a/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb +++ b/lib/two_factor_authentication/hooks/two_factor_authenticatable.rb @@ -7,7 +7,7 @@ if user.respond_to?(:need_two_factor_authentication?) && !bypass_by_cookie if auth.session(options[:scope])[TwoFactorAuthentication::NEED_AUTHENTICATION] = user.need_two_factor_authentication?(auth.request) - user.send_new_otp unless user.totp_enabled? + user.send_new_otp end end end