# HG changeset patch # User Kim Alvefur # Date 1687965440 -7200 # Node ID 5360554769125d93da0490188518334577ffa299 # Parent 6226f75f55a77191e1cf9c60f969acc23b45b8b0 mod_http_file_share: Set slot token TTL so util.jwt validates expiry Overrides the util.jwt default of 1h with the intended TTL of 10 minutes. Because util.jwt now has its own expiry checks, so the 'expiry' field is no longer used and can thus be removed. diff -r 6226f75f55a7 -r 536055476912 plugins/mod_http_file_share.lua --- a/plugins/mod_http_file_share.lua Sun Jun 25 17:34:13 2023 +0200 +++ b/plugins/mod_http_file_share.lua Wed Jun 28 17:17:20 2023 +0200 @@ -49,7 +49,7 @@ local daily_quota = module:get_option_number(module.name .. "_daily_quota", file_size_limit*10); -- 100 MB / day local total_storage_limit = module:get_option_number(module.name.."_global_quota", unlimited); -local create_jwt, verify_jwt = require "prosody.util.jwt".init("HS256", secret); +local create_jwt, verify_jwt = require"prosody.util.jwt".init("HS256", secret, secret, { default_ttl = 600 }); local access = module:get_option_set(module.name .. "_access", {}); @@ -182,7 +182,6 @@ -- slot properties slot = slot; - expires = expiry >= 0 and (os.time()+expiry) or nil; -- file properties filename = filename; filesize = filesize;