Skip to content

Commit

Permalink
[TMA-630][haoliu & llr] convert string json to table.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexuscream committed Feb 26, 2019
1 parent 212a327 commit 1699160
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kong/plugins/okta-auth/okta_api.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local https = require "ssl.https"
local ltn12 = require "ltn12"
local mime = require "mime"
local json = require('cjson')
--local constant = require "kong.plugins.okta-auth.constant"
local singletons = require "kong.singletons"

Expand Down Expand Up @@ -76,7 +77,8 @@ local function fetch_objc_label(oidc_id)
end

local resp = response_body[1] or response_body
return resp["label"]
local tab = json.decode(resp)
return tab["label"]
else
ngx.log(ngx.ERR, "Get Response Failed with wrong formatted")
return nil
Expand Down

0 comments on commit 1699160

Please sign in to comment.