module Foyer::Grape::Helpers
Protected Instance Methods
authenticate_user!()
click to toggle source
# File lib/foyer/grape/helpers.rb, line 14 def authenticate_user! error!('Unauthorized', 401) unless user_signed_in? end
current_user()
click to toggle source
# File lib/foyer/grape/helpers.rb, line 9 def current_user return nil unless headers['Authorization'] =~ /^Bearer (.*)/m @current_user ||= Foyer.token_finder.call(Regexp.last_match[1]) end