Is it possible to get the user id from the cookie without having to verify to user and hit the DB?
Right now I have a call to the database that will check if the user with the id has access to the resource being requested. Because of this I need to get the session which can take ~200ms uncached. I don't really need to verify the user is valid before I get the resource and it would speed things up quite a bit if I could just do that at the same time as I am getting the resource.
Is it possible to just get the userId from the cookie / apiToken without having to hit the DB first?
// gets the userId from the session cookie without hitting the DBconst userId = await auth.api.getUserId();// do this in parallelconst session = auth.api.getSession(...);const resource = getResource(userId);if (!session) error(401);
// gets the userId from the session cookie without hitting the DBconst userId = await auth.api.getUserId();// do this in parallelconst session = auth.api.getSession(...);const resource = getResource(userId);if (!session) error(401);