Commit eed0001 1 parent a2705fb commit eed0001 Copy full SHA for eed0001
File tree 2 files changed +18
-10
lines changed
2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,15 @@ export interface PagesOptions {
364
364
newUser ?: string
365
365
}
366
366
367
+ export interface DefaultSession extends Record < string , unknown > {
368
+ user ?: {
369
+ name ?: string | null
370
+ email ?: string | null
371
+ image ?: string | null
372
+ }
373
+ expires ?: string
374
+ }
375
+
367
376
/**
368
377
* Returned by `useSession`, `getSession`, returned by the `session` callback
369
378
* and also the shape received as a prop on the `Provider` React Context
@@ -373,11 +382,7 @@ export interface PagesOptions {
373
382
* [`Provider`](https://next-auth.js.org/getting-started/client#provider) |
374
383
* [`session` callback](https://next-auth.js.org/configuration/callbacks#jwt-callback)
375
384
*/
376
- export interface Session extends Record < string , unknown > {
377
- user ?: User
378
- accessToken ?: string
379
- expires : string
380
- }
385
+ export interface Session extends Record < string , unknown > , DefaultSession { }
381
386
382
387
/** [Documentation](https://next-auth.js.org/configuration/options#session) */
383
388
export interface SessionOptions {
Original file line number Diff line number Diff line change 1
1
import { JWT as JoseJWT , JWE } from "jose"
2
2
import { NextApiRequest } from "./internals/utils"
3
3
4
+ export interface DefaultJWT extends Record < string , unknown > {
5
+ name ?: string | null
6
+ email ?: string | null
7
+ picture ?: string | null
8
+ sub ?: string
9
+ }
10
+
4
11
/**
5
12
* Returned by the `jwt` callback and `getToken`, when using JWT sessions
6
13
*
7
14
* [`jwt` callback](https://next-auth.js.org/configuration/callbacks#jwt-callback) | [`getToken`](https://next-auth.js.org/tutorials/securing-pages-and-api-routes#using-gettoken)
8
15
*/
9
- export interface JWT extends Record < string , unknown > {
10
- name ?: string | null
11
- email ?: string | null
12
- picture ?: string | null
13
- }
16
+ export interface JWT extends Record < string , unknown > , DefaultJWT { }
14
17
15
18
export interface JWTEncodeParams {
16
19
token ?: JWT
You can’t perform that action at this time.
0 commit comments