Not sure if I am missing something, is this no longer a valid way of adding the sesssion to the Fast...
b
Not sure if I am missing something, is this no longer a valid way of adding the sesssion to the FastifyRequest:
Copy code
ts
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
Copy code
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?
r
hey @bolg55 the way session is verified hasn't changed since a long time. Maybe you missed adding the verifySession middleware?
b
I'll look again, thanks!
3 Views