The password is in the session cookie:

if user && user.authenticate(params[:session][:password])


On Tuesday, July 26, 2016 at 5:19:36 AM UTC-7, Ruby-Forum.com User wrote:
>
> In my SessionController, I tried to authenticate the user but it's 
> failing to authenticate even though I output the information and it's 
> all correct.I'm following this tutorial: 
> https://youtu.be/Hw6WtWJwRtU?list=PLS-X3A6Dr2qPXTSxMf6XPiO9HCkJLe51z 
>
> Below is my code: 
>
> def create 
>     user = User.find_by(email: params[:email].downcase) 
>     if user && user.authenticate(params[:password]) 
>  
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5052b8ef-7b1f-450e-909d-a354ffcd4ecf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to