isomerpages / isomercms-backend

A static website builder and host for the Singapore Government
5 stars 1 forks source link

Fix/validate site name #1128

Closed alexanderleegs closed 8 months ago

alexanderleegs commented 8 months ago

Adds a middleware to validate proper site name for associated routes. This is a quick fix solution - see https://opengovproducts.slack.com/archives/C06FXS46AFP/p1707916279240099 for details.

alexanderleegs commented 8 months ago

Lgtm, are we not able to attach the middleware to the router as a whole?

Hmm in order to retrieve siteName from params the middleware must be used in a route has already defined a :siteName in the route! So I put them in only after they were referenced