Skip to content

Instantly share code, notes, and snippets.

View harrisonmalone's full-sized avatar

Harrison Malone harrisonmalone

View GitHub Profile
@adrian-sal-kennedy
adrian-sal-kennedy / curl-login.sh
Created July 1, 2020 02:39
quick hack to avoid using postman to login in to a local machine and generate a JWT and test to make sure that works...
#!/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