Devise logging out automatically after password change

后端 未结 9 1841
离开以前
离开以前 2020-12-07 19:53

In Devise, if I change user\'s password and after it gets updated in the db, the site immediately logs out the user. I don\'t want this behavior - how do i do that. please h

9条回答
  •  感动是毒
    2020-12-07 20:40

    Add the following piece of code to your method in which you are updating the user's password, right after updating the user's password in the database:

    def update
     . . . . .
     . . . . .
    
     sign_in(@user, :bypass => true)
    
     . . . . .
     . . . . .
    end
    

提交回复
热议问题