plataformatec/devise — Issue #1414: signing out using curl shows a redirect, and doesnt return json response
Author: JohnMerlino1
Created: 2011-11-04 14:51:21+00:00
State: open

Hey all,

I been struggling on this issue for a few days now. I can successfully log in and get a json response through curl. However, when I try to log out in curl, I get this i return:

You are being redirected.

However, when I log out through the application using this:

http://localhost:3000/users/sign_out.json

I succesfully get json back:

{"success":true,"auth_token":null}

So I am wondering what is causing this redirect?

Here's what happens:
curl -H 'Content-Type: application/json' \
> -H 'Accept: application/json' \
> -X POST \
> -H 'X-HTTP-Method-Override: DELETE' http://localhost:3000/users/sign_out \
> -d '{"authentication_token": "shama9fpeLH8PzS4AZXX"}' \
> -c cookie

You are being redirected.

I didnt even get a response on stackoverflow or google groups: http://stackoverflow.com/questions/7997009/rails-3-calling-destroy-method-with-curl

Im running dry of ideas.
thanks for response