Commit 64f6ca5
committed
VPR-54 fix(scheduler): render Razor 403 view for dashboard auth denials
Hangfire's dashboard middleware writes a bare 403 directly to the
response when our IDashboardAuthorizationFilter returns false, which
bypasses cookie auth's AccessDeniedPath and lands the user on the
browser's default error page. Add UseStatusCodePagesWithReExecute so
any bare 4xx/5xx status code re-runs through HomeController.Error and
the existing /Views/Home/403.cshtml view.
Applies globally — also catches stray bare 404s from any other
middleware. Status code is preserved on the response (browser still
sees 403); only the body is replaced with the rendered view.1 parent 3a1c550 commit 64f6ca5
2 files changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
402 | 407 | | |
403 | 408 | | |
404 | 409 | | |
| |||
0 commit comments