rainstop3
rainstop3

Reputation: 1448

what's difference between warden.authenticate? and user.valid_password?

I user Devise in my rails application to authenticate user. I find two method, "warden.authenticate?" and "user.valid_password?". who can tell me what's difference between those.

Upvotes: 4

Views: 621

Answers (1)

Joel
Joel

Reputation: 4603

Devise is built on top of a library called Warden. Warden is a low-level authentication library for Rack and works as a piece of middleware in the stack. Warden provides the basis for Strategies by implementing a Base strategy from which others must inherit.

The warden method is private, so it's not accessible as an action. It needs to be made a helper method if you intend on accessing it from your views.

Hope this helps.

Upvotes: 4

Related Questions