anthonyjgrove / react-google-login

A React Google Login Component
https://anthonyjgrove.github.io/react-google-login
MIT License
1.84k stars 427 forks source link

How to use this safely with Sanity #495

Open saltnpixels opened 2 years ago

saltnpixels commented 2 years ago

I'm thinking of using this with sanity to sign users in. Sanity does not have any roles or permissions or authentication of its own. This video uses this plugin to authenticate a user as seen here: https://youtu.be/1RHDhtbqo94?t=3148

He saves the googleID to localstorage and then creates a new user on the back end with the same ID. Then throughout the code he uses that to access the googleId to fetch the user with the same ID for permissions and stuff.

Is this safe?

I keep reading using cookies and localstorage is not safe... So it gets confusing :/