I am using rails 4.1.8. I have created an API in which user is able to create genrate the auth_token by sessions#create of devise, but now when i try to access sessions#destroy its response is "error: Please sign in or sign up before continuing".
def destroy user = User.find_by(authentication_token: request.headers['Authorization']) user.generate_authentication_token! user.save head 204 end
When I post via postman to http://localhost:3000/api/users/sign_out, its giving above defined error.
GET /api/users/sign_out(.:format) api/devise/sessions#destroy GET /api/users/sign_in(.:format) api/sessions#new POST /api/users/sign_in api/sessions#create DELETE /api/users/sign_out api/sessions#destroy
I want to call destroy so that it can generate new token. How to call it?