Handle non-string authenticity tokens gracefully

Non-string authenticity tokens causes exceptions. These are generated by some automatic scanners that check if an application is vulnerable by replacing authenticity token with non-string data.  


Some automatic scanners check if an application is vulnerable by replacing authenticity token with non-string data.  As `Base64.strict_decode` only handles strings, let's stringify objects before decoding.