mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
feat(ts): use User as Sessionuser type
This commit is contained in:
@@ -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(),
|
||||
},
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user