Skip to content
Discussion options

You must be logged in to vote

I think you can do something like this

const session = await getSession({ req });
const currentSession = await prisma.session.findUnique({
        where: { accessToken:session.accessToken) },
    });
const user = await prisma.user.findUnique({
        where: { id: currentSession?.userId },
    });
const userId = user?.id

but I'm not sure if this is the optimal way.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@YuriGor
Comment options

@iaincollins
Comment options

@balazsorban44
Comment options

@giuseppeg
Comment options

Answer selected by balazsorban44
Comment options

You must be logged in to vote
1 reply
@iaincollins
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
6 participants