Skip to content

Instantly share code, notes, and snippets.

@tbhaxor
Created Mar 24, 2021
Embed
What would you like to do?
Gunicorn token authentication
cat $1 | while read TOKEN; do
content=$(curl -s -H "Authorization: Token $TOKEN" $2)
if echo $content | grep -qi unauth; then continue
else echo $content; break; exit 0
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment