Skip to content

Commit

Permalink
feat(ts): use User as Sessionuser type
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Oct 23, 2023
1 parent c3388bd commit f77704b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/lib/routes/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down
6 changes: 1 addition & 5 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

1 comment on commit f77704b

@vercel
Copy link

@vercel vercel bot commented on f77704b Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.