feat(ts): use User as Sessionuser type

This commit is contained in:
Balázs Orbán
2023-10-23 12:19:26 -07:00
parent c3388bde47
commit f77704bb7e
2 changed files with 2 additions and 6 deletions

View File

@@ -124,11 +124,11 @@ export async function session(params: {
}
// Pass Session through to the session callback
// @ts-expect-error
const sessionPayload = await callbacks.session({
// By default, only exposes a limited subset of information to the client
// as needed for presentation purposes (e.g. "you are logged in as...").
session: {
// @ts-expect-error missing `id`.
user: { name: user.name, email: user.email, image: user.image },
expires: session.expires.toISOString(),
},

View File

@@ -428,11 +428,7 @@ export interface PagesOptions {
type ISODateString = string
export interface DefaultSession {
user?: {
name?: string | null
email?: string | null
image?: string | null
}
user?: User
expires: ISODateString
}