Replies: 1 comment 2 replies
-
@fn-bucket The issue you're facing here is two fold, let me explain. You've enabled the httpOnly flag for the cookie options in If you wish to continue using the @fn-bucket Feel free to ask any other questions you may have. Additional notes:
async function handleLogin() {
- const { data } = (await useAsyncGql({
- operation: 'Authenticate',
- variables: {
- "username": selectedAppUser.value
- }
- }))
+ const { authenticate } = await GqlAuthenticate({ username: selectedAppUser.value })
const authToken = authenticate
useGqlToken(authToken)
await afterLogin()
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I find this problem all over the internet and in the nuxt discord, but never a link or any instructions anywhere on exactly the best way to get the auth cookie translated to the authorization header for my graphql server. Thus, refreshing a page never works.
and I am setting the token
and queries work fine until I refresh the page, then it bombs.
I can see the cookie on the server if I put in a middleware, but from there I am stuck.
Is there more direct documentation on this, or do I just need to learn more Nuxt fundamentals?
https://nuxt.com/docs/guide/directory-structure/server#accessing-request-cookies
this is how I can see the cookie on the server, but I cannot figure out what to do from there...
Beta Was this translation helpful? Give feedback.
All reactions