Verified Commit 17eb03ac authored by Matthew Newton's avatar Matthew Newton Committed by Alexander Clouter

fix error handling if string returned

parent 04fa66ff
......@@ -45,7 +45,7 @@ end
if authorize then
local success, authorized = pcall(authorize.query, args.email)
if not success or not authorized == true then
if not success or not authorized or type(authorized) == "string" then
ngx.log(ngx.WARN, "not authorized: '" .. args.email .. "', reason: " .. tostring(authorized))
if type(authorized) ~= 'string' then
authorized = "not authorized, please contact support"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment