Last active
October 22, 2021 09:31
-
-
Save franee/f84b2a23af161aacf770726f3b0b5847 to your computer and use it in GitHub Desktop.
Get rails authenticity token via cli
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
$ TOKEN=$(curl --location --request GET 'https://some-site/v2/secret/new' | grep csrf | sed -n 's/.*csrf-token.*content="\(.*\)".*/\1/p') | |
$ echo $TOKEN | |
UNF/TKAXsNqIBiZYeMdr2+qaeZg1cAZW3L1+9uqEpd00E6YdSJ1Q6hTU8OUppYB7JIwMxmeoEQYIO2Ycx7ZhyA== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment