bolg55
02/18/2024, 3:24 PMts
import { SessionContainer } from 'supertokens-node/recipe/session';
declare module 'fastify' {
interface FastifyRequest {
session?: SessionContainer;
}
}
I used to be able to write something like:
const userId = request.session?.getUserId()
Now it seems I need to do
ts
import Session from "supertokens-node/recipe/session"
let session = await Session.getSession(req,rep);
const userId = session.getUserId()
Does this mean I have to do this in every route I need that user ID?rp_st
02/18/2024, 3:26 PMbolg55
02/18/2024, 3:28 PM