feat: google auth without schema change

This commit is contained in:
Doug Andrade
2023-06-13 01:53:12 -04:00
parent 05238f096b
commit 2b84636993
5 changed files with 84 additions and 12 deletions

23
packages/lib/types/next-auth.d.ts vendored Normal file
View File

@ -0,0 +1,23 @@
import type { User as PrismaUser } from '@prisma/client';
import type { DefaultUser } from 'next-auth';
declare module 'next-auth' {
interface Session {
user: User;
}
interface User extends Omit<DefaultUser, 'id' | 'image'> {
id: PrismaUser['id'];
email?: PrismaUser['email'];
name?: PrismaUser['name'];
emailVerified?: PrismaUser['emailVerified'];
}
}
declare module 'next-auth/jwt' {
interface JWT {
id: string | number;
name?: string | null;
email: string | null;
}
}