On your rails project root
git clone https://gist.github.com/Jwata/4e5122fa43d719400914716955872cc2 authenticity_token_to_csrf_token
rails runner ./authenticity_token_to_csrf_token/calculate.rb 'some_authenticity_token'
=> 2PqIaqHja/+PllheC7mStH2X+y/E69LlyS5AIfd9MVs= # this is the csrf token stored in your session