refactor lib

This commit is contained in:
2022-06-30 01:58:26 +08:00
parent 2357fa3d7e
commit af95a54aa1
6 changed files with 25 additions and 20 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
local cjson = require "cjson"
--local cjson = require "cjson"
--# https://github.com/SkyLothar/lua-resty-jwt
--$ opm get SkyLothar/lua-resty-jwt
local jwt = require "resty.jwt"
--local jwt = require "resty.jwt"
local function cleanupString(str, remove)
local lcSubStrTab = {}
@@ -63,7 +63,7 @@ local function verifyJwtToken(httpc, token)
end
local function decodeJwtClaim(jwtClaim)
local function decodeJwtClaim(jwtClaim, cjson, jwt)
local jwtKey = "0xCAFEBABE0xCAFEBABE0xCAFEBABE0xCAFEBABE0xCAFEBABE0xCAFEBABE"
local jwtObj = jwt:verify(jwtKey, jwtClaim)