How can I sign out a devise user from the Rails console?

前端 未结 7 1740
一个人的身影
一个人的身影 2021-02-06 21:53

My devise users are \"database_authenticatable\" and \"token_authenticatable\". I\'ve tried deleting the \"authentication_token\" field in the database for that user from the co

7条回答
  •  情话喂你
    2021-02-06 22:15

    Devise provides helper methods to do these things:

    user = User.find(params[:id])
    sign_in user
    sign_out user
    

    Hope this helps.

提交回复
热议问题