cal/packages/types/next-auth.d.ts
Keith Williams 3f273235a6
perf: Cache translations per language/per release (#10843)
Co-authored-by: zomars <zomars@me.com>
2023-08-18 17:46:17 -07:00

39 lines
1.0 KiB
TypeScript

import type { User as PrismaUser, UserPermissionRole } from "@prisma/client";
import type { DefaultUser } from "next-auth";
declare module "next-auth" {
/**
* Returned by `useSession`, `getSession` and received as a prop on the `Provider` React Context
*/
interface Session {
hasValidLicense: boolean;
user: User;
}
interface User extends Omit<DefaultUser, "id"> {
id: PrismaUser["id"];
emailVerified?: PrismaUser["emailVerified"];
email_verified?: boolean;
impersonatedByUID?: number;
belongsToActiveTeam?: boolean;
organizationId?: number | null;
username?: PrismaUser["username"];
role?: PrismaUser["role"] | "INACTIVE_ADMIN";
locale?: string | null;
}
}
declare module "next-auth/jwt" {
interface JWT {
id?: string | number;
name?: string | null;
username?: string | null;
email?: string | null;
role?: UserPermissionRole | "INACTIVE_ADMIN" | null;
impersonatedByUID?: number | null;
belongsToActiveTeam?: boolean;
organizationId?: number | null;
locale?: string;
}
}