Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFR] fix auth client logout action issue #147

Merged
merged 1 commit into from
Jul 10, 2020

Conversation

FacundoMainere
Copy link
Contributor

If we remove the permissions first, then we might have an "unauthorized" response from the server on the DELETE.

Delete permissions first then client.logout():

curl 'http://localhost:3030/authentication' \
  -X 'DELETE' \
  -H 'Connection: keep-alive' \
  -H 'Accept: application/json' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' \
  -H 'Origin: http://localhost:3000' \
  -H 'Sec-Fetch-Site: same-site' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: http://localhost:3000/' \
  -H 'Accept-Language: es,en-US;q=0.9,en;q=0.8' \
  --compressed

client.logout() first then delete permissions:

curl 'http://localhost:3030/authentication' \
  -X 'DELETE' \
  -H 'Connection: keep-alive' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9.eyJwZXJtaXNzaW9ucyI6ImFkbWluIiwiaWF0IjoxNTk0MzEwMzczLCJleHAiOjE1OTQzOTY3NzMsImF1ZCI6Imh0dHBzOi8veW91cmRvbWFpbi5jb20iLCJpc3MiOiJmZWF0aGVycyIsInN1YiI6IjEiLCJqdGkiOiJjYzQ3NGFjZS0zOWFjLTRmMmQtOWM4Zi04MTk0Y2U3NWFlNzUifQ.-y2h2G1RHI5p4_WwALneBVz-kostWj_NG9CWR0PJ5eo' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' \
  -H 'Origin: http://localhost:3000' \
  -H 'Sec-Fetch-Site: same-site' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: http://localhost:3000/' \
  -H 'Accept-Language: es,en-US;q=0.9,en;q=0.8' \
  --compressed

@josx
Copy link
Owner

josx commented Jul 10, 2020

Good catch!

@josx josx merged commit 96268b2 into josx:master Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants