Module: Auth1::SessionsHelper
- Defined in:
- app/helpers/auth1/sessions_helper.rb
Instance Method Summary collapse
- #login_button(name = 'Login', options = nil, html_options = nil, &block) ⇒ Object
- #login_link ⇒ Object
- #login_or_logout_button(name = %w[Login Logout],, options = [nil, nil], html_options = [nil, nil], &block) ⇒ Object
- #login_or_logout_link ⇒ Object
- #logout_button(name = 'Logout', options = nil, html_options = nil, &block) ⇒ Object
- #logout_link ⇒ Object
- #user_signed_in? ⇒ Boolean
Instance Method Details
#login_button(name = 'Login', options = nil, html_options = nil, &block) ⇒ Object
5 6 7 8 9 10 |
# File 'app/helpers/auth1/sessions_helper.rb', line 5 def (name = 'Login', = nil, = nil, &block) ||= '/auth/auth0' ||= {} [:method] = :post (name, , , &block) end |
#login_link ⇒ Object
31 |
# File 'app/helpers/auth1/sessions_helper.rb', line 31 def login_link; end |
#login_or_logout_button(name = %w[Login Logout],, options = [nil, nil], html_options = [nil, nil], &block) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/helpers/auth1/sessions_helper.rb', line 19 def (name = %w[Login Logout], = [nil, nil], = [nil, nil], &block) if user_signed_in? = [1] || {} [:method] = :get (name[1], [1], , &block) else = [0] || {} [:method] = :post (name[0], [0], , &block) end end |
#login_or_logout_link ⇒ Object
35 |
# File 'app/helpers/auth1/sessions_helper.rb', line 35 def login_or_logout_link; end |
#logout_button(name = 'Logout', options = nil, html_options = nil, &block) ⇒ Object
12 13 14 15 16 17 |
# File 'app/helpers/auth1/sessions_helper.rb', line 12 def (name = 'Logout', = nil, = nil, &block) ||= auth1.logout_path ||= {} [:method] = :get (name, , , &block) end |
#logout_link ⇒ Object
33 |
# File 'app/helpers/auth1/sessions_helper.rb', line 33 def logout_link; end |
#user_signed_in? ⇒ Boolean
37 38 39 |
# File 'app/helpers/auth1/sessions_helper.rb', line 37 def user_signed_in? session['userinfo'].present? end |