Applying middleware to the public folder
Hi - I'm trying to authenticate access to a React SPA for which I don't have access to the source code. The SPA is distributed as a set of static files that are simply served from a sub-folder of your public folder. I'm using this SPA, an image viewer, in the context of a larger Tanstack Start app. My first thought was to run a middleware on the Root route and check if the URL matched the sub-folder where the SPA app is installed. Well, I found out that middleware does not run for requests to artifacts in the public folder. I need advice on how to ensure that the SPA is served only to authenticated users.
0 Replies