devise sign out not working after implementation o

2019-07-22 19:52发布

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.

0条回答
登录 后发表回答