Comparison

mod_rest/mod_rest.lua @ 5008:bd63feda3704

Merge role-auth
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Aug 2022 15:39:02 +0100
parent 5001:cb19cb1c03d6
child 5086:dec4b2e31d1c
comparison
equal deleted inserted replaced
4994:cce12a660b98 5008:bd63feda3704
47 if not um.test_password(username, module.host, password) then 47 if not um.test_password(username, module.host, password) then
48 return false; 48 return false;
49 end 49 end
50 return { username = username, host = module.host }; 50 return { username = username, host = module.host };
51 elseif auth_type == "Bearer" then 51 elseif auth_type == "Bearer" then
52 local token_info = tokens.get_token_info(auth_data); 52 if tokens.get_token_session then
53 if not token_info or not token_info.session then 53 return tokens.get_token_session(auth_data);
54 return false; 54 else -- COMPAT w/0.12
55 end 55 local token_info = tokens.get_token_info(auth_data);
56 return token_info.session; 56 if not token_info or not token_info.session then
57 return false;
58 end
59 return token_info.session;
60 end
57 end 61 end
58 return nil; 62 return nil;
59 end 63 end
60 64
61 if module:get_option_string("authentication") == "anonymous" and module:get_option_boolean("anonymous_rest") then 65 if module:get_option_string("authentication") == "anonymous" and module:get_option_boolean("anonymous_rest") then