Upgrade deps + allow node 18.x (#5622)
* Upgrade deps + allow node 18.x * Upgraded next-auth to v4.17 * Latest known to work version of next-auth * Make next-auth.d.ts compatible with [email protected].0 * Type fixes Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
1 parent
6dce57440e
commit
b31b8cc6df
8 files changed
+1252
-149
No files matched your search
Vendored
+11
-10
@@ -1,19 +1,20 @@
|
||||
import { UserPermissionRole } from "@prisma/client";
|
||||
import { DefaultSession } from "next-auth";
|
||||
import { User as PrismaUser } from "@prisma/client";
|
||||
import { DefaultUser } from "next-auth";
|
||||
|
||||
declare module "next-auth" {
|
||||
type DefaultSessionUser = NonNullable<DefaultSession["user"]>;
|
||||
type CalendsoSessionUser = DefaultSessionUser & {
|
||||
id: number;
|
||||
username: string;
|
||||
impersonatedByUID?: number;
|
||||
role: UserPermissionRole;
|
||||
};
|
||||
/**
|
||||
* Returned by `useSession`, `getSession` and received as a prop on the `Provider` React Context
|
||||
*/
|
||||
interface Session {
|
||||
hasValidLicense: boolean;
|
||||
user: CalendsoSessionUser;
|
||||
user: User;
|
||||
}
|
||||
interface User extends Omit<DefaultUser, "id"> {
|
||||
id: PrismaUser["id"];
|
||||
emailVerified?: PrismaUser["emailVerified"];
|
||||
email_verified?: boolean;
|
||||
impersonatedByUID?: number;
|
||||
username?: PrismaUser["username"];
|
||||
role?: PrismaUser["role"];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user