Authjs extending user model for Role based auth trouble.
Recently started to use the new drizzle-adapter for Authjs. And I am having trouble extending the user-model for role based auth. I am not interested in getting the role from my provider (Discord) I want to manage the role in my own DB.
Currently when I try to apply the role as shown in the docs (https://authjs.dev/guides/basics/role-based-access-control) TypeScript says that there are no "role"-property on the AdapterUser.
How do I override the AdapterUser to include my role-property, so TypeScript isn't mad at me. 🙂
I'am using Sveltkit.
Role-based access control | Auth.js
There are two ways to add role-based access control (RBAC) to your application, based on the session strategy you choose. Let's see an example for each of these.
0 Replies