External Backend
import { verify } from 'jsonwebtoken'
const validateJWT = () => {
const authorization = req.headers["authorization"]
if (!authorization) throw new Error("not authenticated")
const token = authorization.split(" ")[1]
verify(token, process.env.JWT_SECRET);
}Last updated