Open CarlosAMendoza opened 3 years ago
I'm experiencing the same issue.
Did you find a solution?
1. No overload matches this call. Overload 1 of 4, '(fn: (user: User, done: (err: any, id?: unknown) => void) => void): void', gave the following error. Argument of type '(user: IUser, done: (err: any, id?: unknown) => void) => void' is not assignable to parameter of type '(user: User, done: (err: any, id?: unknown) => void) => void'. Types of parameters 'user' and 'user' are incompatible. Type 'User' is missing the following properties from type 'IUser': id, first_name, last_name, username, and 3 more. Overload 2 of 4, '(fn: (req: IncomingMessage, user: User, done: (err: any, id?: unknown) => void) => void): void', gave the following error. Argument of type '(user: IUser, done: (err: any, id?: unknown) => void) => void' is not assignable to parameter of type '(req: IncomingMessage, user: User, done: (err: any, id?: unknown) => void) => void'. Types of parameters 'user' and 'req' are incompatible. Type 'IncomingMessage' is missing the following properties from type 'IUser': id, first_name, last_name, username, and 3 more.
I'm trying to use Passportjs, and mongoose for authentication but I am having a hard time getting the correct type with typescript.
I get the error:
This is what my User class looks like: