devise sign out not working after implementation of devise invitable

让人想犯罪 __ 提交于 2019-12-11 06:36:07

问题


all the things were working fine with devise's Registration and session related but when I added devise invitable in the project, after that my session controller's destroy functionality not working. when I clicked on logout button the request sent to here

Started DELETE "/logout" for 127.0.0.1 at 2018-12-15 06:49:20 +0500
Processing by Devise::SessionsController#destroy as HTML
  Parameters:{"authenticity_token"=>"Z9dNZ0yj+pIFkPKaU/Ir7h99b4dYse3KCaQ7GYUm3g6ZAgZVF+B+WmeKouzNwJOcimtUjDuyb6jY3qdSZqC8aw=="}
  User Load (1.0ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
Completed 200 OK in 7ms (ActiveRecord: 1.0ms)

but you can see here is not find any resource and redirect page, there for I getting blank page, so after that I go to any url this show user logged in.

here is my route.rb code for it:

devise_for :users, path: '', path_names: {
 sign_in: 'login',
 sign_out: 'logout',
 sign_up: 'register',
 password: 'reset',
 edit: 'account'
},
controllers: {
 registrations: 'users/registrations',
 confirmations: 'users/confirmations',
 omniauth_callbacks: 'users/omniauth_callbacks',
 invitations: 'users/invitations'
}

and this is my logout link:

<%= link_to destroy_user_session_path, method: :delete do %>
    <span class="text">Logout</span>
<% end %>

Please give me the solution and save my life, because I tried many things to resolve it but not successful.

来源:https://stackoverflow.com/questions/53788974/devise-sign-out-not-working-after-implementation-of-devise-invitable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!