-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Inside NuxtAuthHandler we cannot use useRequestEvent and useRequestHeader #907
Comments
Could you please elaborate a bit? What are you trying to achieve? Some code examples would be nice to understand the problem, thanks |
We manage a session with https://h3.unjs.io/examples/handle-session outside nuxt-auth. This session its bassed on cookies, this session contains a field called createdAt, this value we must checked in JWT session, because its expiration session of auth. This field can be changed, this is the reason because we want read it in JWT function, but NuxtAuthHandler doesnt have access to :
|
Can you provide at least a minimal reproduction? I have hard time following your usecase. You can use You can base it off
|
Hello 👋 Please provide a reproduction for this issue 🙏 How can I create a reproduction?Please use one of the following links to reproduce your issue.
Please ensure that the reproduction is as minimal as possible. This will allow us to isolate the issue as best as possible. Here are some more amazing posts about the importance of reproductions: |
https://stackblitz.com/edit/nuxt-starter-embl4u @phoenix-ru here you are a reproduction, but we cant test it because stackblitz are very slow compiling you can see in plugins/01.session.ts we initialize the H3 cookie session. In server/routes/api/session.get.ts we retreive this H3 cookie session. In server/api/auth/[...].ts in JWT validation, we want to check this H3 cookie session, but returns blank, not the session created in plugin, because in NuxtAuthHandler seems that cookies arent accesible |
Tried to check the reproduction but you're right - Stackblitz is slow - or support of Stackblitz in Nuxt is broken. Unfortunately, need to de-prioritize in favor of #883 |
@phoenix-ru don't worry, prioritize #883, We can advance our development on the other hand, this issue is not a priority. In a few days I will contact you again |
Environment
Linux
v22.7.0
3.13.1
3.13.1
2.9.7
[email protected]
-
-
-
-
Reproduction
we cannot reproduction
Describe the bug
We are trying to use useRequestEvent and useRequestHeaders to access the request cookies but they are not available.
Also we try to access $fetch('/api/session', {method:'GET'}) (this is an access to H3 session) but the cookies not are sending.
There is any option to send cookies to NuxtAuthHandler?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: