Next-Auth real time update with prisma provider
Unanswered
Scaly-naped Pigeon posted this in #help-forum
Scaly-naped PigeonOP
I have next-auth installed in nextjs v15 and i was wondering how can I update session automatically when user table changed in postgresql , I saw an old app someone made this but I am not sure how its made because I tried to update the table but nothing happens and i have to update the session manually but how can I trigger to update sessions automatically on table change?
2 Replies
only way keep the
TTL
short or you can use import { getServerSession } from "next-auth";
const session = await getServerSession(req, res, authOptions);
// Force session update
await session.update();
@Tanzim Hossain only way keep the `TTL` short or you can use `import { getServerSession } from "next-auth";
const session = await getServerSession(req, res, authOptions);
// Force session update
await session.update();`
Scaly-naped PigeonOP
if i forced session.update() , all user session will be updated or only my user machine ?