Express router not routing to correct route due to problem with passport

Jan 25, 2023
Reaction score
please i need help.I have 3 separate files for student ,teacher and admin routing and set the passport/(de)serialize functions on each route i do not know if it is correct and used them in server.js file as general middleware using the use method. when I route with axios .post("http://localhost:5000/student/login", user) in the frontend with react it keeps diverting to admin route. I do not get it? does the middleware I have defined wrong or what? the server console saying TypeError: Cannot read properties of null (reading 'email') at C:\Users\ayex\Desktop\freecodecamp\AASTUweb\server\routes\adminRoutes.js:147:32

here is the github repo for all code. server.js
here is the stackoverflow post


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question