comparison mod_s2s_auth_posh/mod_s2s_auth_posh.lua @ 3287:f0e19a77f81e

mod_s2s_auth_posh: Ensure JWK data decodes to a table
author Kim Alvefur <zash@zash.se>
date Sat, 25 Aug 2018 20:00:45 +0200
parents 517c7f0333e3
children 3eee4029ac6c
comparison
equal deleted inserted replaced
3286:4d1f6d47c889 3287:f0e19a77f81e
52 resume(); 52 resume();
53 return; 53 return;
54 end 54 end
55 log("debug", "Received POSH response"); 55 log("debug", "Received POSH response");
56 local jwk = json.decode(response); 56 local jwk = json.decode(response);
57 if not jwk then 57 if not jwk or type(jwk) ~= "table" then
58 log("error", "POSH response is not valid JSON!\n%s", tostring(response)); 58 log("error", "POSH response is not valid JSON!\n%s", tostring(response));
59 resume(); 59 resume();
60 return; 60 return;
61 end 61 end
62 host_session.posh = { orig = response }; 62 host_session.posh = { orig = response };