27.01.2020, 07:40
Here are JWT libraries from https://github.com/cdbattags/lua-resty-jwt with some minor changes to work on LM. Create a use library with the same name for each attached file.
Code:
jwt = require "user.jwt"
jwt_token = jwt:sign(
"my-secrect-key",
{
header={typ="JWT", alg="HS256"},
payload={foo="bar"}
}
)
log(jwt_token)