Posts by Deise • 1 point
1 post
-
0
votes0
answers23
viewsQ: Authentication with jwt
I have a function to protect the route. Use as follows const authMiddleware = async (req, res, next) => { const token = req.header('Authorization')?.replace('Bearer ', '') if(!token) return…