Sha256: 85b562f7172b14c4f09c65cbadbd0a7d4ef1c6ad65ce32da1323d66ae30a2e85

Contents?: true

Size: 469 Bytes

Versions: 6

Compression:

Stored size: 469 Bytes

Contents

require 'cow_auth/exceptions'

module CowAuth
  module SessionAuth
    module AuthenticateRequest
      extend ActiveSupport::Concern

    private

      def authenticate_user
        @current_user = authentication_class.find_by(sid: session[:current_user])
        raise CowAuth::NotAuthenticatedError.new('User not authenticated.') if @current_user.blank?
        return true
      end

      def current_user
        return @current_user
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cow_auth-0.8.1 lib/cow_auth/session_auth/authenticate_request.rb
cow_auth-0.8.0 lib/cow_auth/session_auth/authenticate_request.rb
cow_auth-0.7.1 lib/cow_auth/session_auth/authenticate_request.rb
cow_auth-0.7.0 lib/cow_auth/session_auth/authenticate_request.rb
cow_auth-0.6.2 lib/cow_auth/session_auth/authenticate_request.rb
cow_auth-0.6.1 lib/cow_auth/session_auth/authenticate_request.rb