You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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