Files
goGin/frontend/types/next-auth.d.ts
Beyhan Oğur 2a5b661443 first commit
2026-04-26 21:46:42 +03:00

48 lines
1.2 KiB
TypeScript

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
}
}