Closed lnvglr closed 10 months ago
A bit old but it can be related to Strapi’s default database connection settings. I have previously same issue, which could be fixed through increasing number of connections:
module.exports = ({ env }) => ({
connection: {
client: "postgres",
connection: {
host: env("DB_HOST", "127.0.0.1"),
port: env.int("DB_PORT", 5432),
database: env("DB_NAME", "devDB"),
user: env("DB_USER", "devUser"),
password: env("DB_PASSWORD", "devPassword"),
ssl: false,
},
pool: {
min: 0,
max: 10,
},
debug: false,
},
});
After some time of inactivity, api calls return a 401, when reloading (once or twice) it works.
I call the api using
useStrapi4()
andfind()
. ThePublic
role has permission tofind
andfindOne
of the collection type I am querying.The request:
The response:
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