1
0
mirror of https://github.com/Fayorg/calendrier-avant.git synced 2026-05-27 17:18:38 +02:00

add: using nextauth WIP

This commit is contained in:
2023-12-15 15:21:51 +01:00
parent 5f049aad5b
commit 2eaccd52e4
7 changed files with 255 additions and 17 deletions

28
types/next-auth.d.ts vendored Normal file
View File

@@ -0,0 +1,28 @@
import NextAuth, { DefaultSession, DefaultJWT, DefaultUser } from "next-auth";
import { JWT } from "next-auth/jwt";
declare module "next-auth" {
interface Session extends Omit<DefaultSession, 'user'> {
user: {
id: number;
firstName: string;
lastName: string
isTeacher: boolean;
};
}
interface User {
id: number;
firstName: string;
lastName: string
isTeacher: boolean;
}
}
declare module "next-auth/jwt" {
interface JWT {
userId: number;
firstName: string;
lastName: string
isTeacher: boolean;
}
}