I have spent no joke like 4 hours trying to do this on @netlify already today and cannot for the life of me figure it out
2
1
can you say more about what the ideal workflow is? if you can set a cookie, you can allow/deny access based on cookie presence docs.netlify.com/routing/red…
2
I followed a few links from there and it looks like possibly this is the answer?
docs.netlify.com/visitor-acc…
1
yeah, that definitely works! here’s some code to change roles if you need to, but in general Netlify Identity / roles will definitely let you gate content
github.com/stripe-samples/ne…
1
I'm still a little confused about Netlify Identity, but it seems like it requires that I manage users in Netlify, which isn't what I want.
Also wow the pricing 😮 $99/month/user in order to be able to use third party JWT tokens?
1
you can do user stuff without plugging into Netlify Identity. the important part is the app_metadata.roles in the token
1
but if you’re looking for a cookie, you can check for that in the redirect and send to auth if it’s not present
the cookie redirect could be:
/* /:splat 200! Cookie=your_cookie
/* /login
login could call a serverless function to set the cookie
1
how can I validate the contents of that cookie? From what I can tell in the docs the redirect method just checks for the presence of the cookie
1
Sounds promising, but I still can't quite see all the pieces. Maybe we should do another livestream and tackle this live!
Jul 24, 2021 · 12:21 AM UTC
1


