Sha256: b4adb8a8085b638a590e6da540fd1a6e628aa30f665280840c12110866b5f653

Contents?: true

Size: 402 Bytes

Versions: 26

Compression:

Stored size: 402 Bytes

Contents

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

26 entries across 26 versions & 2 rubygems

Version Path
hassox-warden-0.2.1 spec/warden/strategies/password.rb
hassox-warden-0.2.2 spec/warden/strategies/password.rb
hassox-warden-0.2.3 spec/warden/strategies/password.rb
hassox-warden-0.3.0 spec/warden/strategies/password.rb
hassox-warden-0.3.1 spec/warden/strategies/password.rb
hassox-warden-0.3.2 spec/warden/strategies/password.rb
warden-0.9.0 spec/helpers/strategies/password.rb
warden-0.8.1 spec/helpers/strategies/password.rb
warden-0.8.0 spec/helpers/strategies/password.rb
warden-0.7.0 spec/helpers/strategies/password.rb
warden-0.6.5 spec/helpers/strategies/password.rb
warden-0.5.3 spec/warden/strategies/password.rb
warden-0.6.4 spec/helpers/strategies/password.rb
warden-0.6.3 spec/helpers/strategies/password.rb
warden-0.6.2 spec/helpers/strategies/password.rb
warden-0.6.1 spec/helpers/strategies/password.rb
warden-0.6.0 spec/helpers/strategies/password.rb
warden-0.5.2 spec/warden/strategies/password.rb
warden-0.5.1 spec/warden/strategies/password.rb
warden-0.5.0 spec/warden/strategies/password.rb