Sha256: 52120a241c8f8c8741307b931652c57aba447d4efbe6195471180ebc514e0c2b

Contents?: true

Size: 423 Bytes

Versions: 1

Compression:

Stored size: 423 Bytes

Contents

Warden::Manager.after_authentication do |user, auth, options|
  if user.respond_to?(:need_two_factor_authentication?) &&
      !auth.env["action_dispatch.cookies"].signed[TwoFactorAuthentication::REMEMBER_TFA_COOKIE_NAME]
    if auth.session(options[:scope])[TwoFactorAuthentication::NEED_AUTHENTICATION] = user.need_two_factor_authentication?(auth.request)
      user.send_two_factor_authentication_code
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
two_factor_authentication-1.1.4 lib/two_factor_authentication/hooks/two_factor_authenticatable.rb