-
Beta Was this translation helpful? Give feedback.
Answered by
nktnet1
Nov 7, 2024
Replies: 1 comment
-
For next-auth v4.24.10 and v5.0.0-beta.25, I'm using the following: /* eslint-disable @typescript-eslint/no-unused-vars */
import { JWT } from "next-auth/jwt"
import NextAuth, { DefaultSession, User } from 'next-auth';
export interface CustomAuthUser extends User {
id: string;
}
declare module 'next-auth' {
interface Session {
user?: CustomAuthUser & DefaultSession['user'];
}
}
declare module 'next-auth/jwt' {
interface JWT {
user?: CustomAuthUser;
}
} Bear in mind that your versions of
and if these can't be updated, you may need to change declare module 'next-auth/jwt' { to declare module '@auth/core/jwt' { |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aboyo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For next-auth v4.24.10 and v5.0.0-beta.25, I'm using the following:
Bear in mind that your versions of
@auth/drizzle-adapter
and@auth/core
, if you're using them in your project could affect the above - e.g.and if these can't …