Help required with verifying a JWT token in Nextjs as I'm encountering the following error:
TypeError: Right-hand side of 'instanceof' is not an object
See below for the code I am currently using:
useEffect(() => {
let token = localStorage.getItem("jqToken") || "";
let result: any = "";
try {
result = jwt.verify(token, "SECRETEKEY");
} catch (error) {
console.log(error, "ERR");
}
console.log("first", result);
}, []);
If anyone has solutions to this issue, please share your thoughts!