forked from hashicorp/dev-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next-auth.d.ts
58 lines (53 loc) · 1.26 KB
/
next-auth.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { DefaultSession } from 'next-auth'
import { AuthErrors } from 'types/auth'
/**
* Below are augmented interfaces on top of the default
* next-auth interfaces https://next-auth.js.org/getting-started/typescript#main-module
*/
declare module 'next-auth' {
/**
* Object representing an authentication session.
*
* Returned by `useSession`, `getSession` and received as a prop on
* the `SessionProvider` React Context.
*/
interface Session {
accessToken?: string
id?: string
error?: AuthErrors
/**
* Object representing an authenticated user.
*/
user?: {
/** The user's HashiCorp ID */
id: string
/** The user's nickname. */
nickname?: string | null
} & DefaultSession['user']
/* Key-value store of additional session data */
meta: Record<string, unknown>
}
/** The OAuth profile returned from your provider */
interface Profile {
picture: string
nickname: string
}
}
declare module 'next-auth/jwt' {
/** Returned by the `jwt` callback */
interface JWT {
access_token: string
refresh_token: string
scope: string
expires_in: number
id_token: string
token_type: 'bearer'
error?: AuthErrors
nickname?: string
picture?: string
}
}