Module: Janus::Helpers

Extended by:
ActiveSupport::Concern
Defined in:
lib/janus/controllers/helpers.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#handle_unverified_requestsObject

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

#janusObject

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, cookies)
end

#signed_in?(scope) ⇒ Boolean

Returns true if a scope user is currently authenticated.

Returns:

  • (Boolean)


29
30
31
# File 'lib/janus/controllers/helpers.rb', line 29

def signed_in?(scope)
  janus.authenticate?(scope)
end