forked from dcramer/gamegame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
37 lines (34 loc) · 955 Bytes
/
types.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
32
33
34
35
36
37
import NextAuth, { type DefaultSession } 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.
*/
interface User {}
/**
* The shape of the account object returned in the OAuth providers' `account` callback,
* Usually contains information about the provider being used, like OAuth tokens (`access_token`, etc).
*/
interface Account {}
/**
* Returned by `useSession`, `auth`, contains information about the active session.
*/
interface Session {
user: {
admin: boolean;
} & DefaultSession["user"];
}
}
export const { auth, handlers } = NextAuth({
callbacks: {
session({ session, token, user }) {
return {
...session,
user: {
...session.user,
admin: user.admin,
},
};
},
},
});