Sha256: 5fa4f18a900c82a86992e9ce6006327e29e20e4c0dcf60483b219910facd0aa8

Contents?: true

Size: 420 Bytes

Versions: 42

Compression:

Stored size: 420 Bytes

Contents

# encoding: utf-8
Warden::Strategies.add(:password) do
  def authenticate!
    request.env['warden.spec.strategies'] ||= []
    request.env['warden.spec.strategies'] << :password
    if params["password"] || params["username"]
      params["password"] == "sekrit" && params["username"] == "fred" ?
        success!("Authenticated User") : fail!("Username or password is incorrect")
    else
      pass
    end
  end
end

Version data entries

42 entries across 41 versions & 6 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/warden-1.2.6/spec/helpers/strategies/password.rb
warden-1.2.6 spec/helpers/strategies/password.rb
warden-1.2.5 spec/helpers/strategies/password.rb
warden-1.2.4 spec/helpers/strategies/password.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/warden-1.2.3/spec/helpers/strategies/password.rb
loyal_warden-2.0.1 spec/helpers/strategies/password.rb
loyal_warden-0.0.5 spec/helpers/strategies/password.rb
warden-1.2.3 spec/helpers/strategies/password.rb
devise_sociable-0.1.0 vendor/bundle/gems/warden-1.0.6/spec/helpers/strategies/password.rb
devise_sociable-0.1.0 vendor/bundle/gems/warden-1.2.1/spec/helpers/strategies/password.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/warden-1.2.1/spec/helpers/strategies/password.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/spec/helpers/strategies/password.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/spec/helpers/strategies/password.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/spec/helpers/strategies/password.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/spec/helpers/strategies/password.rb
warden-1.2.1 spec/helpers/strategies/password.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/warden-1.1.1/spec/helpers/strategies/password.rb
warden-1.2.0 spec/helpers/strategies/password.rb
warden-1.1.1 spec/helpers/strategies/password.rb
warden-1.1.0 spec/helpers/strategies/password.rb