From 6b0c24a9d670fbf94f350c4bce7ef1764a540bf3 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Tue, 12 Sep 2023 12:05:11 -0700 Subject: [PATCH] Update user creation from teams and users services to not set accessedAt accessedAt should only be updated when a user performs some sort of action. Creating a user via the users API or by adding them to a team is an action done by someone else, not the user themselves. As such, the accessedAt timestamp shouldn't update. --- app/controllers/api/teams.php | 1 - app/controllers/api/users.php | 1 - 2 files changed, 2 deletions(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 2e263827a..f20df71da 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -491,7 +491,6 @@ App::post('/v1/teams/:teamId/memberships') 'tokens' => null, 'memberships' => null, 'search' => implode(' ', [$userId, $email, $name]), - 'accessedAt' => DateTime::now(), ]))); } catch (Duplicate $th) { throw new Exception(Exception::USER_ALREADY_EXISTS); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 00520ae8d..bd3ff6766 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -97,7 +97,6 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e 'tokens' => null, 'memberships' => null, 'search' => implode(' ', [$userId, $email, $phone, $name]), - 'accessedAt' => DateTime::now(), ])); } catch (Duplicate $th) { throw new Exception(Exception::USER_ALREADY_EXISTS);