first commit
This commit is contained in:
47
frontend/types/next-auth.d.ts
vendored
Normal file
47
frontend/types/next-auth.d.ts
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { DefaultSession } from "next-auth"
|
||||
|
||||
declare module "next-auth" {
|
||||
/**
|
||||
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
|
||||
*/
|
||||
interface Session {
|
||||
user: {
|
||||
id: string
|
||||
email: string
|
||||
name: string
|
||||
is_admin: boolean
|
||||
username?: string
|
||||
accessToken?: string // Added this line
|
||||
} & DefaultSession["user"]
|
||||
accessToken?: string
|
||||
refreshToken?: string
|
||||
roles?: string[]
|
||||
error?: string
|
||||
}
|
||||
|
||||
interface User {
|
||||
id: string
|
||||
email: string
|
||||
username: string
|
||||
is_admin: boolean
|
||||
accessToken?: string
|
||||
refreshToken?: string
|
||||
roles?: string[]
|
||||
accessTokenExpires?: number
|
||||
}
|
||||
}
|
||||
|
||||
declare module "next-auth/jwt" {
|
||||
/** Returned by the `jwt` callback and `getToken`, when using JWT sessions */
|
||||
interface JWT {
|
||||
id?: string
|
||||
email?: string
|
||||
name?: string
|
||||
is_admin?: boolean
|
||||
accessToken?: string
|
||||
refreshToken?: string
|
||||
roles?: string[]
|
||||
accessTokenExpires?: number
|
||||
error?: string
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user