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

Merge pull request #7 from Fayorg/authentication

Using NextAuth for authentication & Server actions
This commit is contained in:
Elie Baier
2023-12-18 15:06:48 +01:00
committed by GitHub
20 changed files with 535 additions and 345 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 {
user: {
id: number;
firstName: string;
lastName: string
isTeacher: boolean;
} & DefaultSession["user"];
}
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;
}
}