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
When the native @nuxtjs/axios module is configured for retrying, the auth module should still work on a retried request.
What is actually happening?
An error is thrown on SSR regarding checking the Authorization header. If using nuxt error pages, this will instead render an error page instead of the intended page. This is due to getting a different type config object structure in the headers.
Steps to reproduce
In the above example, just visiting the home page directly by address bar or refreshing the page will yield the server error.
ERROR Cannot read property 'Authorization' of undefined 18:50:18
at RequestHandler._requestHasAuthorizationHeader (server.js:4001:35)
at interceptor.axios.interceptors.request.use (server.js:3978:28)
@rico-ocepek I also encountered this issue while setting up the auth for local login. For workarounds, use @nuxt/auth which is the previous version on nuxt auth(4.9.1) instead of @nuxt/auth-next.
Version
module:
5.0.0-1613647907.37b1156
nuxt:
2.14.12
Nuxt configuration
mode:
Nuxt configuration
Reproduction
Reproducible example: https://codesandbox.io/s/busy-gareth-vewyu
What is expected?
When the native @nuxtjs/axios module is configured for retrying, the auth module should still work on a retried request.
What is actually happening?
An error is thrown on SSR regarding checking the Authorization header. If using nuxt error pages, this will instead render an error page instead of the intended page. This is due to getting a different type config object structure in the headers.
Steps to reproduce
In the above example, just visiting the home page directly by address bar or refreshing the page will yield the server error.
Additional information
I believe the root of the bug is here, where deep object accessors don't check that the previous key exists: https://github.com/nuxt-community/auth-module/blob/dev/src/inc/request-handler.ts#L126
I've made a patch locally to not be blocked by a release:
Checklist
Steps to reproduce
What is expected?
What is actually happening?
Performance analysis?
n/a
The text was updated successfully, but these errors were encountered: