Single page app and role based redirect

I’ve got a single page app which I’d like to protect with a role based redirect rule.
Individually, they both work:

I can handle the SPA push state with:

/* index.html 200

And I can handle the role based redirects with:

/* /:splat 200! Role=*

But I can’t seem to be able to combine both… Adding Role seems to prevent the shadowing and causes everything to be replaced by index.html, so for example this doesn’t work:

/* /index.html 200 Role=*
/* /:splat 200! Role=*

Because my js files, which exist, get replaced with the content of index.html…

Is this a limitation of the system or am I just not doing it the right way?

I don’t think you’ll want the second redirect at least not as you have it written - that says that /asset.png should be served by /index.html which would be problematic, right? Is there more than an index file in the repo? If so, the first one should do the trick, but you’ll want “something else” to do with the main content for unauthenticated visitors, as shown in this example:

/protected/* 200! Role=admin
/protected/* /unauthorized.html 404

Also note that role based redirects are only available with business accounts - are you using one? (cf https://www.netlify.com/pricing#teams)

One of my teammates has opened an issue with support about this. They determined it was currently not supported and there’s a feature request.