simple_token_authentication
simple_token_authentication copied to clipboard
Where should I store the token on the frontend?
Hey @gonzalo-bulnes, I love your super simple gem for API authentication.
I'm wondering what's the most secure way to store the token on the frontend. Could you advise, please? Thanks.
localstorage, your can encrypt before storing if u want
@gohyifan check this https://pragmaticstudio.com/tutorials/rails-session-cookies-for-api-authentication
as for localstorage its kinda dangerous because its vulnerable to XSS attack
@imgyf Indeed, the short answer is that you should probably not store these tokens on the frontend. I've added a note about this in the README.
Thanks for the helpful reference @buncis !