Browse Source

Merge pull request #115 from pstaender/master

Check and use if newer bypass_sign_in method exists in devise
master
Dmitrii Golub 8 years ago committed by GitHub
parent
commit
82fb6b192c
  1. 2
      app/controllers/devise/two_factor_authentication_controller.rb

2
app/controllers/devise/two_factor_authentication_controller.rb

@ -30,7 +30,7 @@ class Devise::TwoFactorAuthenticationController < DeviseController
warden.session(resource_name)[TwoFactorAuthentication::NEED_AUTHENTICATION] = false
# For compatability with devise versions below v4.2.0
# https://github.com/plataformatec/devise/commit/2044fffa25d781fcbaf090e7728b48b65c854ccb
if Devise::VERSION.to_f >= 4.2
if respond_to?(:bypass_sign_in)
bypass_sign_in(resource, scope: resource_name)
else
sign_in(resource_name, resource, bypass: true)

Loading…
Cancel
Save