Authentication

Application will not authenticate [sends alert of invalid credentials].
Using user credentials created via rake db:seed. How do I get it to
authenticate?

Agent Model

Application will not authenticate [sends alert of invalid credentials].
Using user credentials created via rake db:seed. How do I get it to
authenticate?

Which bit is not working? See the Rails Guide on debugging for help
on how to debug your code.

Colin

Application will not authenticate [sends alert of invalid credentials].
Using user credentials created via rake db:seed. How do I get it to
authenticate?

Agent Model
----------------

  def Agent\.authenticate\(name,password\)
    if agent = find\_by\_name\(name\)
      if agent\.hash == encrypt\_password\(password,agent\.salt\)

Have you tried calling agent.hash ? I'd wager that that methods
returns something you don't expect, because hash is a method all ruby
objects have - I suspect that you're calling that method rather than
the one that would return the value of your hash column. You can get
at the attribute value via read_attribute, although I'd recommend
avoiding dangerous names like that.

Fred

Colin Law wrote in post #1059060:

Frederick Cheung wrote in post #1059064: