plugins: Switch to :get_option_period() for time range options

Improves readability ("1 day" vs 86400) and centralizes validation.
This commit is contained in:
Kim Alvefur 2023-07-16 20:49:33 +02:00
parent 903e945d09
commit 1987a7411f
18 changed files with 24 additions and 38 deletions

View file

@ -8,7 +8,7 @@ local generate_identifier = require "prosody.util.id".short;
local token_store = module:open_store("auth_tokens", "keyval+");
local access_time_granularity = module:get_option_number("token_auth_access_time_granularity", 60);
local access_time_granularity = module:get_option_period("token_auth_access_time_granularity", 60);
local function select_role(username, host, role_name)
if not role_name then return end