Rails Devise user password is always invalid (tested in rails console) -


i have 1 particular user in rails app can't log in anymore, password invalid, though changed manually. here's in rails console :

> me = user.find(10) > me.password = '123456789' > me.save   (0.3ms)  begin  user exists (0.6ms)  select  1 one "users" ("users"."email" = 'myemail@gmail.com' , "users"."id" != 10) limit 1  sql (0.7ms)  update "users" set "encrypted_password" = $1, "updated_at" = $2 "users"."id" = $3  [["encrypted_password", "$2a$10$mrhwiot3pu6yldtyrd/bc.wuqpthyfjhiqdgkyv14xcafvqntodwg"], ["updated_at", "2016-08-08 10:43:34.715229"], ["id", 10]]   (31.3ms)  commit => true > me.valid_password?('123456789') => nil 

this particular user id 10. exact same thing other user works. wrong ?

edit : tried password confirmation that's not issue. said, exact manipulation works fine user except 1 of id 10

edit 2 : found solution in thread : rails/devise: valid_password? method returns nil

i think need set password_confirmation well, try below code.

> me = user.find(10) > me.password = '123456789' > me.password_confirmation = '123456789' > me.save 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -