mod_oidc_userinfo_vcard4: Unpack <vcard> from PubSub <item>
authorKim Alvefur <zash@zash.se>
Sun, 23 Apr 2023 13:37:58 +0200
changeset 5364 f05de5ac219f
parent 5363 230fc6a0c086
child 5365 cec1b0b0adef
mod_oidc_userinfo_vcard4: Unpack <vcard> from PubSub <item> Forgot about the <item>, so it was previously attempting to extract all properties from that instead of the inner <vcard>
mod_oidc_userinfo_vcard4/mod_oidc_userinfo_vcard4.lua
--- a/mod_oidc_userinfo_vcard4/mod_oidc_userinfo_vcard4.lua	Sat Apr 22 16:29:56 2023 +0200
+++ b/mod_oidc_userinfo_vcard4/mod_oidc_userinfo_vcard4.lua	Sun Apr 23 13:37:58 2023 +0200
@@ -13,6 +13,7 @@
 	local vcard4 = select(3, pep_service:get_last_item("urn:xmpp:vcard4", true));
 
 	local userinfo = event.userinfo;
+	vcard4 = vcard4 and vcard4:get_child("vcard", "urn:ietf:params:xml:ns:vcard-4.0");
 	if vcard4 and event.claims:contains("profile") then
 		userinfo.name = vcard4:find("fn/text#");
 		userinfo.family_name = vcard4:find("n/surname#");