This is great. Thanks to the github repo I got all tests validated. One thing: the seeded user token never seems to successfully delete:
curl --request DELETE \ --url http://localhost:4000/api/sessions \ --header 'authorization: Bearer ...'
passing in the token on the seeded user always fails(401). However, if I create a new user with:
401
curl --request POST \ --url http://localhost:4000/api/users \ --header 'authorization: Bearer ' \ --header 'content-type: application/x-www-form-urlencoded' \ --data 'email=miguel%40toltec&password=miguel%40toltec&name=Miguel%20Coba'
and then I call DELETE /api/sessions whilst passing in the correct token, I get 204. So it appears ok on new users.
DELETE /api/sessions
204
Hi Michael, I just tried and I had no problems at all loggin in the seeded user and then loggin it out.
curl --request POST \ --url http://localhost:4000/api/sessions \ --header 'authorization: Bearer ' \ --header 'content-type: application/x-www-form-urlencoded' \ --data 'email=user%40toltec&password=user%40toltec' {"meta":{"token":"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ0b2x0ZWMiLCJleHAiOjE1MzIzODA0NDQsImlhdCI6MTUyOTk2MTI0NCwiaXNzIjoidG9sdGVjIiwianRpIjoiYzgyNTE3YzctYWUwNS00MDI1LTkzODYtODBkOGU3Yzc0NWUxIiwibmJmIjoxNTI5OTYxMjQzLCJzdWIiOiIxIiwidHlwIjoiYWNjZXNzIn0.XG9BjARniT_uh4txCRiTFucJ1f4b70hJwUjbIqBYZIXw12guLpWgHASDNmd6-kM44MTMZQcDm96nYGB2X3dAvw"},"data":{"name":"some user","id":1,"email":"user@toltec"}}% curl --request DELETE \ --url http://localhost:4000/api/sessions \ --header 'authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ0b2x0ZWMiLCJleHAiOjE1MzIzODA0NDQsImlhdCI6MTUyOTk2MTI0NCwiaXNzIjoidG9sdGVjIiwianRpIjoiYzgyNTE3YzctYWUwNS00MDI1LTkzODYtODBkOGU3Yzc0NWUxIiwibmJmIjoxNTI5OTYxMjQzLCJzdWIiOiIxIiwidHlwIjoiYWNjZXNzIn0.XG9BjARniT_uh4txCRiTFucJ1f4b70hJwUjbIqBYZIXw12guLpWgHASDNmd6-kM44MTMZQcDm96nYGB2X3dAvw' --verbose * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 4000 (#0) > DELETE /api/sessions HTTP/1.1 > Host: localhost:4000 > User-Agent: curl/7.54.0 > Accept: */* > authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ0b2x0ZWMiLCJleHAiOjE1MzIzODA0NDQsImlhdCI6MTUyOTk2MTI0NCwiaXNzIjoidG9sdGVjIiwianRpIjoiYzgyNTE3YzctYWUwNS00MDI1LTkzODYtODBkOGU3Yzc0NWUxIiwibmJmIjoxNTI5OTYxMjQzLCJzdWIiOiIxIiwidHlwIjoiYWNjZXNzIn0.XG9BjARniT_uh4txCRiTFucJ1f4b70hJwUjbIqBYZIXw12guLpWgHASDNmd6-kM44MTMZQcDm96nYGB2X3dAvw > < HTTP/1.1 204 No Content < server: Cowboy < date: Mon, 25 Jun 2018 21:14:48 GMT < content-length: 11 < content-type: application/json; charset=utf-8 < cache-control: max-age=0, private, must-revalidate < x-request-id: 2kto7btq4eeicq8l4o000731 < access-control-allow-origin: * < access-control-expose-headers: < access-control-allow-credentials: true < * Excess found in a non pipelined read: excess = 11 url = /api/sessions (zero-length body) * Connection #0 to host localhost left intact
Are you sure that in the delete curl command, you used a valid token that you got from the loggin cur action. Maybe you used the one from my example?
Cheers
Finally got back to this. Yes, that was the problem.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is great. Thanks to the github repo I got all tests validated. One thing: the seeded user token never seems to successfully delete:
passing in the token on the seeded user always fails(
401
). However, if I create a new user with:and then I call
DELETE /api/sessions
whilst passing in the correct token, I get204
. So it appears ok on new users.Hi Michael, I just tried and I had no problems at all loggin in the seeded user and then loggin it out.
Are you sure that in the delete curl command, you used a valid token that you got from the loggin cur action. Maybe you used the one from my example?
Cheers
Finally got back to this. Yes, that was the problem.