forked from james-elicx/cloudy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnextauth.d.ts
31 lines (28 loc) · 881 Bytes
/
nextauth.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type NextAuth, { DefaultSession, DefaultUser } from 'next-auth';
declare module 'next-auth' {
/**
* The shape of the user object returned in the OAuth providers' `profile` callback,
* or the second parameter of the `session` callback, when using a database.
*/
export interface User extends DefaultUser {
/** Unique ID in the database. */
id: number;
}
/**
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
*/
export interface Session {
user: DefaultSession['user'] & {
/** Unique ID in the database. */
id: number;
};
}
}
declare module 'next-auth/jwt' {
/** Returned by the `jwt` callback and `getToken`, when using JWT sessions */
interface JWT extends DefaultJWT {
/** Unique ID in the database. */
id: number;
}
}