New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request missing headers after error-handling through error page #14842
Comments
The middleware will be called the second time when rendering the error page. The headers, etc., are deliberately not present on this page so it can be cached. If you would like to render something on the error page dependent on user headers, then you should set it on the error object itself which can be passed to your custom (see #14758) cc: @pi0 |
@danielroe How i can pass user Bearer token to error page, to render header like github and without caching token? |
#14780 sounds like my issue (close it and keep this one if it is). I believe this functionality should be optional in some way unless it's safe to pass headers to the error call 🤔 There are many cases we want to persist a user being logged in despite showing an error page it's really weird seeing the user not logged for a brief moment. |
#7669 |
I hope that this issue will get some kind of solution, I think it's pretty important and hurts ux for users. A temporary solution would be welcome too, I personally haven't found a way to make it work unfortunately. |
With last RC.12 we explicitly disable cache for |
Environment
Nuxt CLI v3.0.0-rc.4 10:33:52
RootDir: 10:33:53
Nuxt project info: 10:33:53
Darwin
v14.19.3
3.0.0-rc.4
yarn@1.22.15
vite
alias
,modules
,css
,build
,vite
@pinia/nuxt@0.1.9
,shared-front/nuxt/axios
,shared-front/nuxt/cookies
,shared-front/nuxt/registry
,shared-front/nuxt/domain
,shared-front/nuxt/theme
,shared-front/nuxt/components
,shared-front/nuxt/mq-handler
-
Reproduction
https://stackblitz.com/edit/github-pgghw6
Describe the bug
After handling error, nitro make request to
/__nuxt_error
, but this request lost all headers, and ErrorPage cannot access themhttps://github.com/nuxt/framework/blob/bb8942a401cef3d41c39e9d50e6630e766998c1c/packages/nuxt/src/core/runtime/nitro/error.ts#L47
Additional context
Fixed with this code
Logs
The text was updated successfully, but these errors were encountered: