Sha256: beb5e32a2818401ddcf30ba2679760ed084b134c15500892950c5299d7966d4b

Contents?: true

Size: 487 Bytes

Versions: 5

Compression:

Stored size: 487 Bytes

Contents

require 'devise/strategies/authenticatable'

module Devise

  module Strategies
    class RemoteUserAuthenticatable < Authenticatable

      def valid?
        DeviseRemoteUser.remote_user_id(env).present?
      end

      def authenticate!
        resource = mapping.to.find_for_remote_user_authentication(env)
        resource ? success!(resource) : fail
      end

    end
  end
end

Warden::Strategies.add(:remote_user_authenticatable, Devise::Strategies::RemoteUserAuthenticatable)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
devise-remote-user-1.1.0 lib/devise_remote_user/strategy.rb
devise-remote-user-1.0.0 lib/devise_remote_user/strategy.rb
devise-remote-user-0.6.0 lib/devise_remote_user/strategy.rb
devise-remote-user-0.4.1 lib/devise_remote_user/strategy.rb
devise-remote-user-0.4.0 lib/devise_remote_user/strategy.rb