mod_sasl2_fast/mod_sasl2_fast.lua
changeset 5307 b10a7082b3c3
parent 5291 4834eaf24fc1
child 5886 563c2c70cb9f
equal deleted inserted replaced
5306:ba94a5301985 5307:b10a7082b3c3
   243 	if new and new.expires_at >= curr_time and (not last_password_change or last_password_change < new.issued_at) then
   243 	if new and new.expires_at >= curr_time and (not last_password_change or last_password_change < new.issued_at) then
   244 		return true;
   244 		return true;
   245 	end
   245 	end
   246 	return false;
   246 	return false;
   247 end
   247 end
       
   248 
       
   249 function revoke_fast_tokens(username, client_id)
       
   250 	local client_id_hash = hash.sha256(client_id, true);
       
   251 	local cur_ok = token_store:set(username, client_id_hash.."-cur", nil);
       
   252 	local new_ok = token_store:set(username, client_id_hash.."-new", nil);
       
   253 	return cur_ok and new_ok;
       
   254 end