1

So recently I decided that I need to access a protected api endpoint in google app script. The only thing I can find is app-script-oauth2, the reason this does not work is because my middleware for the tRPC endpoint (code below) says if there is not a session (which is stored in a prisma db) you cannot access the api.

.middleware(async ({ ctx: { session }, next }) => {
  if (!session) {
    throw new TRPCError({ code: "UNAUTHORIZED" });
  }
  return next();
})

I have also tried to login and try to make the request but it seems as if the request is completely unrelated to the local session. I know this isn't a ton to work from but any help at all would be greatly appreciated.

juliomalves
  • 42,130
  • 20
  • 150
  • 146
Noah -
  • 33
  • 7

0 Answers0