Skip to content

Commit

Permalink
fix(ts): make User interface overridable using module augmentation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
comxd authored Jan 7, 2025
1 parent b1e9984 commit 7772375
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,20 @@ export interface DefaultSession {
/** The active session of the logged in user. */
export interface Session extends DefaultSession {}

/**
* The shape of the returned object in the OAuth providers' `profile` callback,
* available in the `jwt` and `session` callbacks,
* or the second parameter of the `session` callback, when using a database.
*/
export interface User {
export interface DefaultUser {
id?: string
name?: string | null
email?: string | null
image?: string | null
}

/**
* The shape of the returned object in the OAuth providers' `profile` callback,
* available in the `jwt` and `session` callbacks,
* or the second parameter of the `session` callback, when using a database.
*/
export interface User extends DefaultUser {}

// Below are types that are only supposed be used by next-auth internally

/** @internal */
Expand Down

0 comments on commit 7772375

Please sign in to comment.