aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_auth_insecure.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-08-18 18:10:44 +0200
committerKim Alvefur <zash@zash.se>2022-08-18 18:10:44 +0200
commit742153c55540bd9de365e775bd71c5c4544d88f8 (patch)
treedd063f50bfc848765c8fcccaba44a216f51a69db /plugins/mod_auth_insecure.lua
parent6f11c198b30fc581a2de25cdb3fe0b29c1d48eda (diff)
downloadprosody-742153c55540bd9de365e775bd71c5c4544d88f8.tar.gz
prosody-742153c55540bd9de365e775bd71c5c4544d88f8.zip
mod_auth_insecure: Store creation and update timestamps on account
This ensures that the store is not empty in case no password is provided, so the underlying data storage won't consider the store empty.
Diffstat (limited to 'plugins/mod_auth_insecure.lua')
-rw-r--r--plugins/mod_auth_insecure.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_auth_insecure.lua b/plugins/mod_auth_insecure.lua
index dc5ee616..5428d1fa 100644
--- a/plugins/mod_auth_insecure.lua
+++ b/plugins/mod_auth_insecure.lua
@@ -27,6 +27,7 @@ function provider.set_password(username, password)
return nil, "Password fails SASLprep.";
end
if account then
+ account.updated = os.time();
account.password = password;
return datamanager.store(username, host, "accounts", account);
end
@@ -38,7 +39,8 @@ function provider.user_exists(username)
end
function provider.create_user(username, password)
- return datamanager.store(username, host, "accounts", {password = password});
+ local now = os.time();
+ return datamanager.store(username, host, "accounts", { created = now; updated = now; password = password });
end
function provider.delete_user(username)