Sha256: 3b838e29ebb2a6bea9e903bff595f4dbbf388e809462a3b3b5020df49881b790

Contents?: true

Size: 749 Bytes

Versions: 15

Compression:

Stored size: 749 Bytes

Contents

require_relative 'listener'

class CASino::SecondFactorAuthenticationAcceptorListener < CASino::Listener

  def user_not_logged_in
    @controller.redirect_to login_path
  end

  def user_logged_in(url, ticket_granting_ticket, cookie_expiry_time = nil)
    @controller.cookies[:tgt] = { value: ticket_granting_ticket, expires: cookie_expiry_time }
    if url.nil?
      @controller.redirect_to sessions_path, status: :see_other
    else
      @controller.redirect_to url, status: :see_other
    end
  end

  def invalid_one_time_password
    @controller.flash.now[:error] = I18n.t('validate_otp.invalid_otp')
  end

  def service_not_allowed(service)
    assign(:service, service)
    @controller.render 'service_not_allowed', status: 403
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
casino-3.0.4 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.7 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-3.0.3 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-3.0.2 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-3.0.1 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-3.0.0 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-3.0.0.pre.2 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-3.0.0.pre.1 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.6 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.5 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.4 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.3 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.2 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.1 app/listeners/casino/second_factor_authentication_acceptor_listener.rb
casino-2.0.0 app/listeners/casino/second_factor_authentication_acceptor_listener.rb