comparison mod_http_admin_api/mod_http_admin_api.lua @ 4378:d4e0e4d22fc7

mod_http_admin_api: Add 'reset' property to returned invite objects Indicates the invite is for a password reset.
author Matthew Wild <mwild1@gmail.com>
date Sat, 23 Jan 2021 13:03:14 +0000
parents 03cf0d41b272
children 0d6b69777bc1
comparison
equal deleted inserted replaced
4377:a0f1fb5e7829 4378:d4e0e4d22fc7
63 63
64 local function token_info_to_invite_info(token_info) 64 local function token_info_to_invite_info(token_info)
65 local additional_data = token_info.additional_data; 65 local additional_data = token_info.additional_data;
66 local groups = additional_data and additional_data.groups or nil; 66 local groups = additional_data and additional_data.groups or nil;
67 local source = additional_data and additional_data.source or nil; 67 local source = additional_data and additional_data.source or nil;
68 local reset = not not (additional_data and additional_data.allow_reset or nil);
68 return { 69 return {
69 id = token_info.token; 70 id = token_info.token;
70 type = token_info.type; 71 type = token_info.type;
71 reusable = not not token_info.reusable; 72 reusable = not not token_info.reusable;
72 inviter = token_info.inviter; 73 inviter = token_info.inviter;
75 landing_page = token_info.landing_page; 76 landing_page = token_info.landing_page;
76 created_at = token_info.created_at; 77 created_at = token_info.created_at;
77 expires = token_info.expires; 78 expires = token_info.expires;
78 groups = groups; 79 groups = groups;
79 source = source; 80 source = source;
81 reset = reset;
80 }; 82 };
81 end 83 end
82 84
83 function list_invites(event) 85 function list_invites(event)
84 local invites_list = {}; 86 local invites_list = {};