Skip to content

Instantly share code, notes, and snippets.

@smijar
Created January 6, 2023 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smijar/1633634be8b9cb44235f46c59de54b1b to your computer and use it in GitHub Desktop.
Save smijar/1633634be8b9cb44235f46c59de54b1b to your computer and use it in GitHub Desktop.
Retrieves JWT token and uses it for "curl" calls
export JWT_TOKEN=$(curl -s -H "Content-Type:application/json" -XPOST http://localhost:8080/tokenz -d '{"email":"youremail@youremaildomain.app", "password":"password"}' | jq -r '.token')
curl -H "Content-Type:application/json" -H "Authorization: Bearer $JWT_TOKEN" $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment