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

Joined
Jan 25, 2023
Messages
1
Reaction score
0
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
 

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top