2022-04-26 08:48:17 +00:00
|
|
|
import { UserPermissionRole } from "@prisma/client";
|
2022-01-07 20:23:37 +00:00
|
|
|
import NextAuth, { DefaultSession } from "next-auth";
|
|
|
|
|
|
|
|
declare module "next-auth" {
|
|
|
|
type DefaultSessionUser = NonNullable<DefaultSession["user"]>;
|
|
|
|
type CalendsoSessionUser = DefaultSessionUser & {
|
|
|
|
id: number;
|
|
|
|
username: string;
|
2022-04-26 08:48:17 +00:00
|
|
|
impersonatedByUID?: number;
|
|
|
|
role: UserPermissionRole;
|
2022-01-07 20:23:37 +00:00
|
|
|
};
|
|
|
|
/**
|
|
|
|
* Returned by `useSession`, `getSession` and received as a prop on the `Provider` React Context
|
|
|
|
*/
|
|
|
|
interface Session {
|
|
|
|
user: CalendsoSessionUser;
|
|
|
|
}
|
|
|
|
}
|