Class: Mumukit::Login::Provider::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/mumukit/login/provider/base.rb

Direct Known Subclasses

Auth0, Developer, Saml

Instance Method Summary collapse

Instance Method Details

#auth_pathObject



20
21
22
# File 'lib/mumukit/login/provider/base.rb', line 20

def auth_path
  "/auth/#{name}"
end

#button_html(controller, title, clazz) ⇒ Object



32
33
34
# File 'lib/mumukit/login/provider/base.rb', line 32

def button_html(controller, title, clazz)
  %Q{<a class="#{clazz}" href="#{login_path(controller)}">#{title}</a>}
end

#callback_pathObject



24
25
26
# File 'lib/mumukit/login/provider/base.rb', line 24

def callback_path
  "/auth/#{name}/callback"
end

#configure_rails_forgery_protection!(action_controller) ⇒ Object



12
13
14
# File 'lib/mumukit/login/provider/base.rb', line 12

def configure_rails_forgery_protection!(action_controller)
  action_controller.protect_from_forgery with: :exception
end


36
37
38
# File 'lib/mumukit/login/provider/base.rb', line 36

def footer_html(*)
  nil
end

#header_htmlObject



40
41
42
# File 'lib/mumukit/login/provider/base.rb', line 40

def header_html(*)
  nil
end

#login_path(controller) ⇒ Object



16
17
18
# File 'lib/mumukit/login/provider/base.rb', line 16

def (controller)
  "/login?origin=#{controller.request.path}"
end

#logout_redirection_pathObject



28
29
30
# File 'lib/mumukit/login/provider/base.rb', line 28

def logout_redirection_path
  '/'
end

#nameObject



2
3
4
# File 'lib/mumukit/login/provider/base.rb', line 2

def name
  @name ||= self.class.name.demodulize.downcase
end

#request_authentication!(controller, _login_settings) ⇒ Object



8
9
10
# File 'lib/mumukit/login/provider/base.rb', line 8

def request_authentication!(controller, )
  controller.redirect! auth_path
end