From 5cb9cc9dfd5d3aece907a4739ef5367824e52a32 Mon Sep 17 00:00:00 2001 From: Prateek Banga Date: Sat, 20 May 2023 02:36:45 +0530 Subject: [PATCH] fix expire field in list account sessions api --- app/controllers/api/account.php | 1 + tests/e2e/Services/Account/AccountBase.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index dd5ac4a2da..5108091b36 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1389,6 +1389,7 @@ App::get('/v1/account/sessions') $session->setAttribute('countryName', $countryName); $session->setAttribute('current', ($current == $session->getId()) ? true : false); + $session->setAttribute('expire', DateTime::addSeconds(new \DateTime($session->getCreatedAt()), $authDuration)); $sessions[$key] = $session; } diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index ba751516d3..c4401d6c6f 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -308,6 +308,8 @@ trait AccountBase $this->assertEquals(true, $response['body']['sessions'][0]['current']); + $this->assertEquals(true, $response['body']['sessions'][0]['expire']); + /** * Test for FAILURE */