This repository has been archived on 2026-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
Flam3rboy 524b5df723 api
2021-08-12 20:09:35 +02:00

14 lines
316 B
TypeScript

import jwt from "jsonwebtoken";
const algorithm = "HS256";
const iat = Math.floor(Date.now() / 1000);
// @ts-ignore
const token = jwt.sign({ id: "311129357362135041" }, "secret", {
algorithm,
});
console.log(token);
const decoded = jwt.verify(token, "secret", { algorithms: [algorithm] });
console.log(decoded);