ReferenceError: User is not defined
at Strategy._verify (C:\Projects\config\passport.js:9:5)
at Strategy.authenticate (C:\Projects\node_modules\passport-local\lib\strategy.js:90:12)
at attempt (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:366:16)
at authenticate (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:367:7)
at Layer.handle [as handle_request] (C:\Projects\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Projects\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\Projects\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Projects\node_modules\express\lib\router\layer.js:95:5)
at C:\Projects\node_modules\express\lib\router\index.js:281:22
at Function.process_params (C:\Projects\node_modules\express\lib\router\index.js:335:12)
at next (C:\Projects\node_modules\express\lib\router\index.js:275:10)
at SessionStrategy.strategy.pass (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:343:9)
at SessionStrategy.authenticate (C:\Projects\node_modules\passport\lib\strategies\session.js:75:10)
at attempt (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:366:16)
at authenticate (C:\Projects\node_modules\passport\lib\middleware\authenticate.js:367:7)
at Layer.handle [as handle_request] (C:\Projects\node_modules\express\lib\router\layer.js:95:5)
You have to create a User Schema in a models.js and export it to your passport config file
How can you say that without knowing that what he actually doing or defining with that user.
User is not defined so either he ddin''t create it or he didn't require it
I did it then to it is showing error
The same error ?
yes.User is not defined