diff --git a/resources/tokenisation/minter/token_gen.lua b/resources/tokenisation/minter/token_gen.lua
--- a/resources/tokenisation/minter/token_gen.lua
+++ b/resources/tokenisation/minter/token_gen.lua
#
@@ -92,6 +92,13 @@ local function mint_token(path,expires,ip,secret)
#
+local function getPath(str,sep)
#
+ -- From https://stackoverflow.com/questions/9102126/lua-return-directory-path-from-path
#
+ return str:match("(.*"..sep..")")
#
local function sendFailed(reason)
#
local r = {status = false, token = 'failed', exp = '-1', msg = reason}
#
@@ -207,7 +214,7 @@ end
#
-- Calculate when the token should expire
#
local expires = os.time() + tokenlife
#
-local tok = mint_token(vidpath,expires,ip,secret)
#
+local tok = mint_token(getPath(vidpath),expires,ip,secret)