Recently started using Express and been struggling with this particular error for quite a while.
const token=req.header("jwt")
console.log(token)
if(!token ){
return res.json('no jwt')
console.log('nojwt')
}
try{
const logged_in=verify(token,'j_token')
console.log(logged_in)
if(logged_in){
req.user=logged_in
next();
}}catch{err=>console.log(err)}
}
I'm still not receiving the response of 'no jwt' even when I am not sending the jwt.