mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 21:57:45 +03:00
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.
This commit is contained in:
parent
bb06c42b07
commit
e590c9c92e
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue