maxgalbu / adonis5-jwt

JWT Authentication service for Adonisjs v5
MIT License
86 stars 15 forks source link

Prisma support #20

Closed Droutin closed 1 year ago

Droutin commented 1 year ago

Please provide support for Prisma https://github.com/wahyubucil/adonis-prisma

henriquetroiano commented 1 year ago

Already has, i'm using!

On config\auth.ts :

jwt: {
      driver: "jwt",
      publicKey: Env.get("JWT_PUBLIC_KEY", "").replace(/\\n/g, "\n"),
      privateKey: Env.get("JWT_PRIVATE_KEY", "").replace(/\\n/g, "\n"),
      persistJwt: false,
      jwtDefaultExpire: "365d",
      refreshTokenDefaultExpire: "365d",
      tokenProvider: {
        type: "jwt",
        driver: "redis",
        redisConnection: "local",
        foreignKey: "user_id",
      },
      provider: {
        driver: "prisma",
        identifierKey: "id",
        uids: ["email"],
        model: "user",
      },
    },