Sha256: 60264f7b93d5ffcadcf81b41825a6bb3975420cd6cba5c74e86fb505f8636066

Contents?: true

Size: 354 Bytes

Versions: 6

Compression:

Stored size: 354 Bytes

Contents

module MotionPrime
  module HasAuthorization
    def current_user
      if defined?(User) && User.respond_to?(:current)
        @current_user = User.current
      end
    end
    def user_signed_in?
      current_user.present?
    end
    def api_client
      @api_client ||= ApiClient.new(access_token: current_user.try(:access_token))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
motion-prime-0.2.1 motion-prime/helpers/has_authorization.rb
motion-prime-0.2.0 motion-prime/helpers/has_authorization.rb
motion-prime-0.1.7 motion-prime/helpers/has_authorization.rb
motion-prime-0.1.6 motion-prime/helpers/has_authorization.rb
motion-prime-0.1.5 motion-prime/helpers/has_authorization.rb
motion-prime-0.1.4 motion-prime/helpers/has_authorization.rb