Module: Janus::Helpers
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/janus/controllers/helpers.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#handle_unverified_requests ⇒ Object
Signs the current user out (from all scopes at once) in case of a CSRF attack.
-
#janus ⇒ Object
Returns the current instance of Janus::Manager.
-
#signed_in?(scope) ⇒ Boolean
Returns true if a scope user is currently authenticated.
Instance Method Details
#handle_unverified_requests ⇒ Object
Signs the current user out (from all scopes at once) in case of a CSRF attack. See ActionController::RequestForgeryProtection for documentation.
23 24 25 26 |
# File 'lib/janus/controllers/helpers.rb', line 23 def handle_unverified_requests janus.logout super end |
#janus ⇒ Object
Returns the current instance of Janus::Manager.
17 18 19 |
# File 'lib/janus/controllers/helpers.rb', line 17 def janus @janus ||= Janus::Manager.new(request, ) end |
#signed_in?(scope) ⇒ Boolean
Returns true if a scope user is currently authenticated.
29 30 31 |
# File 'lib/janus/controllers/helpers.rb', line 29 def signed_in?(scope) janus.authenticate?(scope) end |