Class: CASino::LoginCredentialAcceptorListener

Inherits:
Listener
  • Object
show all
Defined in:
app/listeners/casino/login_credential_acceptor_listener.rb

Instance Method Summary collapse

Methods inherited from Listener

#initialize

Constructor Details

This class inherits a constructor from CASino::Listener

Instance Method Details

#invalid_login_credentials(login_ticket) ⇒ Object



18
19
20
21
# File 'app/listeners/casino/login_credential_acceptor_listener.rb', line 18

def ()
  @controller.flash.now[:error] = I18n.t('login_credential_acceptor.invalid_login_credentials')
  ()
end

#invalid_login_ticket(login_ticket) ⇒ Object



23
24
25
26
# File 'app/listeners/casino/login_credential_acceptor_listener.rb', line 23

def ()
  @controller.flash.now[:error] = I18n.t('login_credential_acceptor.invalid_login_ticket')
  ()
end

#service_not_allowed(service) ⇒ Object



28
29
30
31
# File 'app/listeners/casino/login_credential_acceptor_listener.rb', line 28

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

#two_factor_authentication_pending(ticket_granting_ticket) ⇒ Object



13
14
15
16
# File 'app/listeners/casino/login_credential_acceptor_listener.rb', line 13

def two_factor_authentication_pending(ticket_granting_ticket)
  assign(:ticket_granting_ticket, ticket_granting_ticket)
  @controller.render 'validate_otp'
end

#user_logged_in(url, ticket_granting_ticket, cookie_expiry_time = nil) ⇒ Object



4
5
6
7
8
9
10
11
# File 'app/listeners/casino/login_credential_acceptor_listener.rb', line 4

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