Loading...
Loading...
JsonWebTokenError: invalid signatureThis error means the JWT's signature does not match. Either the token was tampered with, the wrong secret/key was used to verify it, or the token was signed with a different algorithm than expected.
Use our JWT Decoder to inspect the 'alg' field in the header and ensure your verification matches.
Ensure the JWT_SECRET environment variable is identical in both the signing and verifying services.
// Signing
const token = jwt.sign(payload, process.env.JWT_SECRET);
// Verifying — must use the SAME secret
jwt.verify(token, process.env.JWT_SECRET);