module Xenon::Routing::SecurityDirectives
Public Instance Methods
authenticate(authenticator) { |user| ... }
click to toggle source
# File lib/xenon/routing/security_directives.rb, line 8 def authenticate(authenticator) extract_request(authenticator) do |user| if user yield user else reject :unauthorized, { scheme: authenticator.scheme }.merge(authenticator.auth_params) end end end
optional_authenticate(authenticator) { |user| ... }
click to toggle source
# File lib/xenon/routing/security_directives.rb, line 18 def optional_authenticate(authenticator) extract_request(authenticator) do |user| yield user end end