Comparison

plugins/mod_tokenauth.lua @ 13271:56c1d2498d66

mod_tokenauth: Delete grants in the wrong formats on retrieval
author Kim Alvefur <zash@zash.se>
date Mon, 09 Oct 2023 20:26:30 +0200
parent 13246:2e04d54fb013
child 13272:8535a6105919
comparison
equal deleted inserted replaced
13270:14bbfb2cc8dd 13271:56c1d2498d66
157 module:log("debug", "Token grant expired, cleaning up"); 157 module:log("debug", "Token grant expired, cleaning up");
158 token_store:set_key(username, grant.id, nil); 158 token_store:set_key(username, grant.id, nil);
159 return nil, "expired"; 159 return nil, "expired";
160 end 160 end
161 161
162 if not grant.tokens then
163 module:log("debug", "Token grant without tokens, cleaning up");
164 token_store:set_key(username, grant.id, nil);
165 return nil, "invalid";
166 end
162 return grant; 167 return grant;
163 end 168 end
164 169
165 local function _get_validated_token_info(token_id, token_user, token_host, token_secret) 170 local function _get_validated_token_info(token_id, token_user, token_host, token_secret)
166 if token_host ~= module.host then 171 if token_host ~= module.host then