Nextauth jwt configuration

I am making a simple task manager application using google apis with the t3 stack and I am having difficulty getting the user id from my session. I have my session strategy set to jwt because of token issues I was encountering with oauth. Currently, I have a task router, which uses a protected procedure to create a new task in my db, which requires a userid, title, and category. I'm pretty confident that my issue is surrounding jwt, in that when I create a task on the front end I get an error stating that my userid is undefined. I've tried passing the id as input, but the issue pertains to the session, so that also results in the userid being undefined. I am going to put my config below. The error: tRPC failed on task.add: Invalid prisma.task.create() invocation: { data: { title: 'fffffff', category: '', userId: undefined, + user: { + create?: UserCreateWithoutTasksInput | UserUncheckedCreateWithoutTasksInput, + connectOrCreate?: UserCreateOrConnectWithoutTasksInput, + connect?: UserWhereUniqueInput + }, ? createdAt?: DateTime, ? updatedAt?: DateTime } } Argument user for data.user is missing. Note: Lines with + are required, lines with ? are optional.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server