29 lines
586 B
TypeScript
29 lines
586 B
TypeScript
// Ref: https://next-auth.js.org/getting-started/typescript#module-augmentation
|
|
|
|
import { DefaultSession, DefaultUser } from 'next-auth';
|
|
import { JWT, DefaultJWT } from 'next-auth/jwt';
|
|
import type { UserRole } from '@prisma/client';
|
|
|
|
declare module 'next-auth' {
|
|
interface Session {
|
|
user: {
|
|
id: string;
|
|
role: UserRole;
|
|
name: string;
|
|
image: string;
|
|
};
|
|
}
|
|
|
|
interface User extends DefaultUser {
|
|
id: number;
|
|
role: UserRole;
|
|
}
|
|
}
|
|
|
|
declare module 'next-auth/jwt' {
|
|
interface JWT extends DefaultJWT {
|
|
id: string;
|
|
role: UserRole;
|
|
}
|
|
}
|