Middleware + SSG #3808
davidturissini
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I could be missing something from the docs, but I can't find a good answer there so I figured I'd ask here.
I have an app that can almost be fully SSG. We have an SPA architecture + some marketing pages so Astro is a good fit. One piece that I'm having trouble integrating though are redirects for authenticated users into our app. Basically, if a user visits our domain and they are authenticated, we want to redirect them to our application. I can do this with middleware no problem. The problem is that the page in question can be prerendered, but it seems that when prerendering is turned on, middleware is also disabled for that endpoint. One thing I can do is implement the redirect directly in express. I'd like to avoid doing that so that everything remains organized in Astro. Is it possible to have an prerendered page and have Astro still execute middleware for that route?
Beta Was this translation helpful? Give feedback.
All reactions