first commit
This commit is contained in:
27
types/next-auth.d.ts
vendored
Normal file
27
types/next-auth.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import NextAuth from "next-auth";
|
||||
|
||||
declare module "next-auth" {
|
||||
interface Session {
|
||||
user: {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
image?: string;
|
||||
role: string; // "SUPER_ADMIN" | "DOMAIN_ADMIN"
|
||||
domains: string[]; // ["*"] or ["domain1.com", "domain2.com"]
|
||||
};
|
||||
}
|
||||
|
||||
interface User {
|
||||
role?: string;
|
||||
domains?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
declare module "next-auth/jwt" {
|
||||
interface JWT {
|
||||
id?: string;
|
||||
role?: string;
|
||||
domains?: string[];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user