anomaly / easel

A set of functions, configuration files and instructions to allow users to build their own subscriber or paid content site using Netlify, Stripe and Netlify Identity. It supports pages and digital downloads
MIT License
0 stars 0 forks source link

Outline _redirects based security rules #3

Open devraj opened 2 years ago

devraj commented 2 years ago

Netlify allows protecting content based on a configuration file, outline a process of mapping subscriptions to roles and let Netlify handle the protection of content

[[redirects]]
  from = "/gated-path"
  status = 200
  conditions = {Role = ["admin"]}
  force = true

If the user does not have a role we should provide a meaningful fallback and the option to redirect to authentication or manage their subscription.

devraj commented 1 year ago

I've had more success with _redirects than the toml file, for now I am moving to using the _redirects as the solution.