In my backend I have(/api/add-db-users.ts):
await updateSession(req, res, {
...session,
user: { ...session.user, 'https://localhost:3000.com/appmetadata': { localUserCreated: true } },
})
const session2 = await getSession(req, res)
console.log('session2', session2)
session2 shows the updated appmetadata property. But when I call,
const session = await getSession(req, res)
anywhere else in the app, it has the old data. if I sign out then back in, the data is there.
How can I update the appmetadata field and get that updated value throughout my Next.js app?
I’m using
"@auth0/nextjs-auth0": "^2.0.0",
"next": "13.0.2",