From 8b40a76e768c8ede2fbcc8964ae4a17229e0004d Mon Sep 17 00:00:00 2001 From: TheTrunk Date: Fri, 20 Sep 2024 10:37:10 +0700 Subject: [PATCH] update access_time and status on login --- src/rest_server.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/rest_server.cpp b/src/rest_server.cpp index c9e9d50..da97328 100644 --- a/src/rest_server.cpp +++ b/src/rest_server.cpp @@ -701,6 +701,17 @@ namespace lws if (is_hidden(account->first)) return {lws::error::account_not_found}; + // Update access time + auto update_result = disk.update_access_time(req.creds.address); + if (!update_result) + return update_result.error(); + + // Move account state to active + epee::span address_span(&req.creds.address, 1); + auto change_status_result = disk.change_status(db::account_status::active, address_span); + if (!change_status_result) + return change_status_result.error(); + // Do not count a request for account creation as login return response{false, bool(account->second.flags & db::account_generated_locally)}; }