For mobile API using rails 4 , sign_in and sign_up functionality is working in rest API Mozilla browser but for sign_out it is not working. Devise is not able to map sessions Controller Destroy method. following is my code:
in routes file:
devise_for :consumers , :controllers => {
:registrations => 'API/registrations',
}
first we sign_in through :http://dev.demo.com/api/consumers/sign_in?user_login[login]=demo@demo.com&user_login[password]=demo1234
并得到回应:
{
"success": true,
"auth_token": "SgChaANPLC7ez53spDBJAw",
"email": "demo@demo.com"
}
但是当我们注销时:http://dev.demo.com/api/consumers/sign_out.json?auth_token=SgChaANPLC7ez53spDBJAw我们 得到错误:{“错误”:“您需要先登录或注册才能继续。” 如何解决这个问题?