Nov 8, 2021
Hey Brian, loving the new site! I'm wanting to add authentication to my own site, but only for myself to edit content. I'm interested to know how you handle the authentication so only you can edit the content?
I wrote a bit about how I did this in the past here: https://brianlovin.com/writing/just-for-me-authentication
Hopefully that post is a good enough kickstart to a single-player auth mode with cookies. Right now, my system is a bit more complex since I do need to distinguish between myself and everyone else, but also there are sometimes mixed permissions (e.g. I can delete any comment, otherwise only the comment author can delete a comment). All of that is handled at my GraphQL resolver layer — like this, for example https://github.com/brianlovin/briOS/blob/main/src/graphql/resolvers/mutations/comment/index.tsx#L15