XataX
Xata13mo ago
3 replies
mrcentigrade

@auth/xata-adapter issue.

i've a sveltekit app (svelte 4) and i am using authjs (nextauth) to implement google signin. signout / signout works. however i've noticed that
updateSession
doesn't work. i spent some time and bumped my authjs related packages to the latest i.e.
@auth/core@latest @auth/sveltekit@latest @auth/xata-adapter@latest
.

my session config is as follows:
  session: {
    strategy: 'database',
    // Session will be valid for 24 hours
    maxAge: 30 * 24 * 60 * 60, // 30 days in seconds
    // Update session every 4 hours if user is active
    updateAge: 24 * 60 * 60, // 24 hours in seconds
    // Generate new session ID on every update
    generateSessionToken: () => crypto.randomUUID()
  },


when i console log the
nextauth_session
record i get the following output:
{
  // ...
  "xata_createdat": null,
  "xata_id": null,
  "xata_updatedat": null,
  "xata_version": null,
  "xata": {
    "createdAt": "2025-01-22T07:33:36.971Z",
    "updatedAt": "2025-01-22T07:33:36.971Z",
    "version": 0
  }
}


the adapter is looking for the flat
xata_*
fields, but they're nested in the
xata
object.

so i have to manually clear my cookies and signin again.

is there any way to get around this?
Was this page helpful?