I'm trying to log data to the console in my node project and nothing happened. i use a middleware function before GET and there is no log
exports.protect = catchAsync(async (req, res, next) => {
//1)Getting token and check of its there
let token;
if (
req.headers.authorization &&
req.headers.authorization.startsWith('Bearer')
) {
token = req.header.authorization.split(' ')[1];
}
console.warn(token);
//2) verification token
//3) check if user still exist
//4) check if user change password afterr token made
next();
});
