Skip to content
Discussion options

You must be logged in to vote

I solved it by adding types.d.ts in my project.

extends interface "User" the of module "next-auth"

import 'next-auth'

declare module 'next-auth' {
  export interface User {
    _id?: string
    firstname?: string
    lastname?: string
    username?: string
  }
}

example extends other interface

/* eslint @typescript-eslint/no-empty-interface: "off" */
import 'next-auth'
import { UserObject } from './my-code/user'

declare module 'next-auth' {
  export interface User extends UserObject  {}
}

=============

Would be cool to do something like this in next-auth :/

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@balazsorban44
Comment options

@typedashutosh
Comment options

@balazsorban44
Comment options

@typedashutosh
Comment options

@balazsorban44
Comment options

Answer selected by typedashutosh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants