This commit is contained in:
2024-12-23 21:34:50 +01:00
parent 3d0d721896
commit dd6843091b
3 changed files with 242 additions and 172 deletions

View File

@@ -80,6 +80,8 @@ local function ensure_token_file()
local token_file = config.values.config_file
local token_data = read_token_file(token_file)
if token_data and token_data ~= "" then
-- Trim leading/trailing whitespace/newlines so we don't send a trailing "\n"
token_data = token_data:gsub("^%s+", ""):gsub("%s+$", "")
token_cached = token_data
return
end
@@ -106,4 +108,4 @@ function M.get_token()
return token_cached
end
return M
return M