Sha256: 746504f81fa2bec05a4e8a31494ce3bb4e287ef5745b35e3c8afef6f58fbcf8f
Contents?: true
Size: 570 Bytes
Versions: 12
Compression:
Stored size: 570 Bytes
Contents
module Workarea module Api module Storefront module Authentication extend ActiveSupport::Concern class InvalidError < RuntimeError; end included do helper_method :current_user end def self.find_user(token, options) User::AuthenticationToken.authenticate(token, options).try(:user) end def current_user current_visit.current_user || raise(InvalidError) end def authentication? current_visit.logged_in? end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems