Could somebody help me with authentication with pr...
# orm-help
g
Could somebody help me with authentication with prisma from the server? I get token like this:
Copy code
const token = jwt.sign(
  {
    data: {
      service: 'karma-api@' + process.env.NODE_ENV,
    },
  },
  config.PRISMA_SECRET,
);
then how should I use it? somewhere here?
Copy code
const server = new GraphQLServer({
  typeDefs: 'src/schema.graphql',
  resolvers,
  context: req => ({
    ...req,
    prisma: new Prisma({
      typeDefs: 'src/generated/prisma.graphql',
      endpoint: config.PRISMA_ENDPOINT,
    }),
  }),
});
n
you don't need to create your own token when using
prisma-binding
. You can pass in the
secret
directly, as seen here: https://github.com/graphql-boilerplates/node-graphql-server/blob/master/advanced/src/index.js#L9
g
i see, awesome, thanks 🙂
👍 1