adonis-prisma
adonis-prisma copied to clipboard
Token provider
In the readme, we understand how to implement prisma with auth.
But for web api using token, what should be the config for the auth.ts for the token provider ?
Thanks.
This is what I used in my config
import type { AuthConfig } from "@ioc:Adonis/Addons/Auth";
const authConfig: AuthConfig = {
guard: "api",
guards: {
api: {
driver: "oat",
tokenProvider: {
type: "api",
driver: "redis",
redisConnection: "local",
foreignKey: "user_id",
},
provider: {
driver: "prisma",
identifierKey: "id",
uids: ["email"],
model: "user",
},
},
},
};
export default authConfig;