Sha256: caf57630a8342f5f93e3d861e8a41066a502ef10f5bbfcc9baef30e6c0698749
Contents?: true
Size: 427 Bytes
Versions: 3
Compression:
Stored size: 427 Bytes
Contents
module Foyer module Grape module Helpers extend ActiveSupport::Concern include Foyer::API::Helpers protected def current_user return nil unless headers['Authorization'] =~ /^Bearer (.*)/m @current_user ||= Foyer.token_finder.call(Regexp.last_match[1]) end def authenticate_user! error!('Unauthorized', 401) unless user_signed_in? end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
foyer-0.5.0 | lib/foyer/grape/helpers.rb |
foyer-0.4.0 | lib/foyer/grape/helpers.rb |
foyer-0.3.1 | lib/foyer/grape/helpers.rb |