aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_file_share.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-04-05 17:16:18 +0200
committerKim Alvefur <zash@zash.se>2021-04-05 17:16:18 +0200
commite590c9c92ee9a3818f3e5141d718bc07613848d5 (patch)
tree1b2b521a61ece74be2317122737288b1449e12cc /plugins/mod_http_file_share.lua
parentbb06c42b0793e9860ec7b2a7259f7065826c95ab (diff)
downloadprosody-e590c9c92ee9a3818f3e5141d718bc07613848d5.tar.gz
prosody-e590c9c92ee9a3818f3e5141d718bc07613848d5.zip
mod_http_file_share: Include time of issuance in auth token
In case an external upload service wants to have the original creation time, or calculate the token expiry itself.
Diffstat (limited to 'plugins/mod_http_file_share.lua')
-rw-r--r--plugins/mod_http_file_share.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua
index d082bee7..9e542dff 100644
--- a/plugins/mod_http_file_share.lua
+++ b/plugins/mod_http_file_share.lua
@@ -133,10 +133,12 @@ function may_upload(uploader, filename, filesize, filetype) -- > boolean, error
end
function get_authz(slot, uploader, filename, filesize, filetype)
+local now = os.time();
return jwt.sign(secret, {
-- token properties
sub = uploader;
- exp = os.time()+300;
+ iat = now;
+ exp = now+300;
-- slot properties
slot = slot;