strapi
strapi copied to clipboard
Server responds with 401 after some time of inactivity, works after reload
After some time of inactivity, api calls return a 401, when reloading (once or twice) it works.
I call the api using useStrapi4() and find(). The Public role has permission to find and findOne of the collection type I am querying.
The request:
...
mounted() {
this.$strapi.find("home").then(({data}) => {
this.page = data;
});
},
...
The response:
{
"data": null,
"error": {
"status": 401,
"name": "UnauthorizedError",
"message": "Missing or invalid credentials",
"details": {}
}
}
I have a hunch that it may have something to do the the JWT token, but I don't know how to debug it.
Strapi 4.1.9 Nuxt 3.0.0-rc.5 DB Postgres Hosted on Railway.app