skip to Main Content

Javascript – Jwt Invalid Token

const verifyToken = async (req, res, next) => { try { if(req.headers["authorization"] && req.headers.authorization) { const token = req.headers["authorization"].split(" ")[1]; if(token) { const user_data = await User.findOne({ auth_token: token }); if(user_data) { const jwtEmail = user_data?user_data.email.split("@")[0]:''; const decodedToken = jwt.verify(token,…

VIEW QUESTION
Back To Top
Search