|
|
@ -23,6 +23,15 @@ private |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def after_two_factor_success_for(resource) |
|
|
|
|
|
|
|
set_remember_two_factor_cookie(resource) |
|
|
|
|
|
|
|
warden.session(resource_name)[TwoFactorAuthentication::NEED_AUTHENTICATION] = false |
|
|
|
|
|
|
|
bypass_sign_in(resource, scope: resource_name) |
|
|
|
|
|
|
|
resource.update!(second_factor_attempts_count: 0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
redirect_to after_two_factor_success_path_for(resource) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def after_two_factor_success_path_for(resource) |
|
|
|
def after_two_factor_success_path_for(resource) |
|
|
|
if resource.is_a?(User) && resource.support? |
|
|
|
if resource.is_a?(User) && resource.support? |
|
|
|
"/organisations" |
|
|
|
"/organisations" |
|
|
|