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

前端 未结 7 1733
一个人的身影
一个人的身影 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 22:01

    You can create a logout link in views->layouts->application.html.erb as:-

    <= link_to 'Log Out', destroy_user_session_path, method: :delete %>
    

    It worked for me - hope it does for others as well.

提交回复
热议问题