I have had this problem for a while and not really got an answer.
I have a svelte frontend / directus backend. I have updated both the directus sdk and directus to latest versions and upgraded node to 18.14.0.
After login the directus_refresh_token cookie is stored with an appropriate value.
My code is
await directus.auth.logout().
then(() => {
console.log("logout OK - auth token is " + $authToken)
/* do stuff */
})
.catch((error) => {
console.log("Logout error " + error)
});
In the console, I get
Cookie “directus_refresh_token” has been rejected because it is already expired.
logout OK - auth token is eyJhbGciOiJIU......hKTIzHi0aLX4
So why the cookie is rejected (it is seconds old)?
I would just add that previous to today I was getting problems with auth.refresh errors even though I never actually call it. But upgrading directus / the sdk / node may have got rid of that.