Class: Mumukit::Login::Provider::Base
- Inherits:
-
Object
- Object
- Mumukit::Login::Provider::Base
- Defined in:
- lib/mumukit/login/provider/base.rb
Instance Method Summary collapse
- #auth_path ⇒ Object
- #button_html(controller, title, clazz) ⇒ Object
- #callback_path ⇒ Object
- #configure_rails_forgery_protection!(action_controller) ⇒ Object
- #footer_html ⇒ Object
- #header_html ⇒ Object
- #login_path(controller) ⇒ Object
- #logout_redirection_path ⇒ Object
- #name ⇒ Object
- #request_authentication!(controller, _login_settings) ⇒ Object
Instance Method Details
#auth_path ⇒ Object
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 (controller, title, clazz) %Q{<a class="#{clazz}" href="#{login_path(controller)}">#{title}</a>} end |
#callback_path ⇒ Object
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 |
#footer_html ⇒ Object
36 37 38 |
# File 'lib/mumukit/login/provider/base.rb', line 36 def (*) nil end |
#header_html ⇒ Object
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 login_path(controller) "/login?origin=#{controller.request.path}" end |
#logout_redirection_path ⇒ Object
28 29 30 |
# File 'lib/mumukit/login/provider/base.rb', line 28 def logout_redirection_path '/' end |
#name ⇒ Object
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, _login_settings) controller.redirect! auth_path end |