|
|
@ -12,7 +12,7 @@ module TwoFactorAuthentication |
|
|
|
def handle_two_factor_authentication |
|
|
|
def handle_two_factor_authentication |
|
|
|
unless devise_controller? |
|
|
|
unless devise_controller? |
|
|
|
Devise.mappings.keys.flatten.any? do |scope| |
|
|
|
Devise.mappings.keys.flatten.any? do |scope| |
|
|
|
if signed_in?(scope) and warden.session(scope)['need_two_factor_authentication'] |
|
|
|
if signed_in?(scope) and warden.session(scope)[TwoFactorAuthentication::NEED_AUTHENTICATION] |
|
|
|
handle_failed_second_factor(scope) |
|
|
|
handle_failed_second_factor(scope) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -42,7 +42,7 @@ module Devise |
|
|
|
module Controllers |
|
|
|
module Controllers |
|
|
|
module Helpers |
|
|
|
module Helpers |
|
|
|
def is_fully_authenticated? |
|
|
|
def is_fully_authenticated? |
|
|
|
!session["warden.user.user.session"].try(:[], 'need_two_factor_authentication') |
|
|
|
!session["warden.user.user.session"].try(:[], TwoFactorAuthentication::NEED_AUTHENTICATION) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|