Created
July 1, 2020 02:39
-
-
Save adrian-sal-kennedy/401005d7b9d7c926423e22b19ad12fb9 to your computer and use it in GitHub Desktop.
quick hack to avoid using postman to login in to a local machine and generate a JWT and test to make sure that works...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JWT=$(curl --location --request POST 'http://localhost:3000/login' --header 'Content-Type: application/json' --data-raw '{"auth": {"email": "sal@sal.com","password": "password"}}') | |
JWT=$(echo ${JWT} | awk -F\" '{print $4}') | |
CLI="curl --location --request GET 'http://localhost:3000/status' --header 'Authorization: Bearer "${JWT}"'" | |
echo $CLI | |
eval $CLI | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment