-
Notifications
You must be signed in to change notification settings - Fork 58
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
Logout Function Error "Invalid Payload" #254
Comments
Could you also share any where is What happens when you do the following? <template>
<div>
<button @click="logout()">Logout</button>
</div>
</template>
<script setup>
const { logout } = useDirectusAuth()
</script> |
@sandros94 Thanks for the response. Yeah I forgot to include that statement in my ticket. I have that exact code in the logout component...just with some styling. In terms of my
I am using Directus 10.10.4 that is self-hosted on a Docker Compose instance. Here is a screenshot of the response I get: |
I reverted From what I have read - as of 15.0.0 - the SDK auth composable has a new Looking through the docs at the moment. |
yeah I'm also looking for a way to reproduce it, but haven't been able to atm. Indeed the |
I just did a basic test with the following and got the same result - Nuxt 3.11.1 The latest
|
Sorry for delay, but I'm not able to reproduce this. Are you, by any chance, also logging in with the Directus App interface? To solve this you could either use nuxt-directus/playground/nuxt.config.ts Lines 8 to 12 in 8030e51
|
Hello, I get the same error using the suggested config.
Directus: 10.10.5 The {
"refresh_token": "***",
"mode" :"cookie"
} but errors with: {
"errors": [
{
"message": "Invalid payload. The refresh token is required in either the payload or cookie.",
"extensions": {
"code": "INVALID_PAYLOAD",
"reason": "The refresh token is required in either the payload or cookie"
}
}
]
} "directus": {
"authConfig": {
"useNuxtCookies": true,
"refreshTokenCookieName": "nuxt-directus_refresh_token"
},
"moduleConfig": {
"nuxtImage": {
"useAuthToken": false,
"useStaticToken": true
}
}
}, I noticed that the {
"refresh_token": "***",
"mode" :"json"
} I copied the |
@ymilhahn you might have found it! But I need to do some refactoring and tests. I'll update |
Yup, confirmed. The actual issue is upstream but since I need to also implement the session based auth mode I'll take this opportunity to prevent it from happening. Also, in the meantime, would you be able to test out login and logouts via client? const { client } = useDirectusAuth()
await client.login(email, password)
await client.logout() |
@sandros94 This issue is resolved from my point of view! |
Thanks for the update @ymilhahn, @pvenableh feel free to reopen if you still have issues |
Thank you @sandros94 and @ymilhahn! Updated and all works as intended.
Which is using Really appreciate the help and quick updates. |
Maybe I'm missing something crucial, but all these changes described above are not reflected in any way in the current documentation. |
@bennyzen if you are referring to the messages back in april then yes you have to look at this other documentation (for But please do keep an eye on #273 to be notified when it gets merged, since it will break a lot of functionalities of how I haven't yet rewritten neither user nor auth logics, so I cannot comment on how they will work. If you want to leave an opinion of how you use them you can do so at #271 |
Version
nuxt-directus-next: 0.0.14
nuxt: 3.11.1
Steps to reproduce
Login with simple function:
Successfully logs in and creates two cookies: 'directus_access_token' and 'directus_refresh_token'.
Attempt logout with simple function:
What is Expected?
Expected to logout user and remove tokens.
Error response: "Invalid payload. The refresh token is required in either the payload or cookie."
The text was updated successfully, but these errors were encountered: