Hi,
I''m trying to use the Warden gem via RailsWarden. It is not working,
but I guess I don''t understand a few things.
How do you access a Rack thing from a method in your controller?
env[:warden] fails with a method not found error for env.
I want only certain actions to check to see if the user is logged in.
I assumed that warden was doing all the work since my strategy checked
for the correct password. I didn''t need to do anything in my
controller login action
Here is the strategy code:
Warden::Strategies.add(:password) do
def valid?
params[:login][:password]
puts "logging in"
end
def authenticate!
puts "authenticating"
params[:login][:password] == ''password'' ? success! : fail!
end
end
However any password succeeds. Indeed the puts are never happening.
Does/can warden log what it is doing? Nothing is getting logged to the
console or development.log.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.