-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use custom session and user types
- Loading branch information
1 parent
262c986
commit 9f9dc16
Showing
5 changed files
with
35 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import NextAuth, { DefaultSession } from 'next-auth'; | ||
|
||
declare module 'next-auth' { | ||
/** | ||
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context | ||
*/ | ||
interface Session { | ||
accessToken: string; | ||
user: User & DefaultSession['user']; | ||
} | ||
|
||
interface User { | ||
id: string; | ||
name?: string | null; | ||
email?: string | null; | ||
image?: string | null; | ||
client_roles: string[]; | ||
given_name: string | null; | ||
family_name: string | null; | ||
preferred_username: string | null; | ||
email: string | null; | ||
idir_username: string | null; | ||
} | ||
} |