# HG changeset patch # User Matthew Wild # Date 1665859293 -3600 # Node ID 5cc6f37493766683f6bff5fed0983dcb0de07065 # Parent e8342ae5ae1271b9b9ed7bae309e2627cee810a9 mod_sasl2_fast: Fix make_token() to return appropriate result diff -r e8342ae5ae12 -r 5cc6f3749376 mod_sasl2_fast/mod_sasl2_fast.lua --- a/mod_sasl2_fast/mod_sasl2_fast.lua Fri Oct 14 16:21:01 2022 +0100 +++ b/mod_sasl2_fast/mod_sasl2_fast.lua Sat Oct 15 19:41:33 2022 +0100 @@ -17,12 +17,16 @@ local new_token = "secret-token:fast-"..id.long(); local key = hash.sha256(client_id, true).."-new"; local issued_at = now(); - token_store:set(username, key, { + local token_info = { mechanism = mechanism; secret = new_token; issued_at = issued_at; expires_at = issued_at + fast_token_ttl; - }); + }; + if not token_store:set(username, key, token_info) then + return nil; + end + return token_info; end local function new_token_tester(username, hmac_f)