After upgrading the Keystone core from version 1 to version 4.0.1 the authenticatedItem query always returns null, even though I am logged in.
Logging in either through my Next frontend or through the admin UI's login screen is successful and this can be verified in the Apollo dev tools tab.
The error is visible in the following ways:
- Running the authenticatedItem query from the GraphQL playground returns null
- The admin UI loads, but anything related to the session fails (e.g. I can't see the name of the logged in user)
- The frontend is unusable since whenever it queries the session it gets null in return
The session does exist. If I run a custom mutation from the GraphQL playground, it receives the session on the context object.
The session config object in the Keystone config looks like this:
const sessionConfig = {
maxAge: 60 * 60 * 24 * 30,
secret: process.env.COOKIE_SECRET,
sameSite: 'lax',
secure: true,
domain: process.env.DOMAIN || undefined,
path: "/",
};
I have seen versions of the same issue, but in those it seems only queries from the frontend are an issue. In my case it's also an issue in the admin UI and in the API playground.
Any help greatly appreciated as I need to deliver a new version of this application.