Commit f560195
committed
fix(inertia-sails): inject inertiaContext middleware when order is not configured
When sails.config.http.middleware.order is not explicitly defined (the
default for all Sails apps), the hook skipped injecting the
inertiaContext middleware entirely. This caused sails.inertia.share()
calls in routes.before handlers to run outside AsyncLocalStorage
context, silently dropping shared props.
Initialize the middleware order with Sails' defaults when undefined,
then inject inertiaContext before the router as intended.
Closes #1931 parent 960657a commit f560195
1 file changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
132 | 147 | | |
133 | 148 | | |
134 | 149 | | |
| |||
0 commit comments