Fxi teams tests

This commit is contained in:
Damodar Lohani
2025-09-10 07:57:45 +00:00
parent 487663f892
commit 6099313cb4
2 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -2954,8 +2954,9 @@ App::patch('/v1/account/password')
->inject('dbForProject')
->inject('queueForEvents')
->inject('hooks')
->inject('store')
->inject('proofForPassword')
->action(function (string $password, string $oldPassword, ?\DateTime $requestTimestamp, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks, ProofsPassword $proofForPassword) {
->action(function (string $password, string $oldPassword, ?\DateTime $requestTimestamp, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks, Store $store, ProofsPassword $proofForPassword) {
$userProofForPassword = ProofsPassword::createHash($user->getAttribute('hash'), $user->getAttribute('hashOptions'));
// Check old password only if its an existing user.
@@ -2995,7 +2996,10 @@ App::patch('/v1/account/password')
->setAttribute('hashOptions', $proofForPassword->getHash()->getOptions());
$sessions = $user->getAttribute('sessions', []);
$current = Auth::sessionVerify($sessions, Auth::$secret);
$proofsToken = new ProofsToken();
$current = Auth::sessionVerify($sessions, $store->getProperty('secret', ''), $proofsToken);
$invalidate = $project->getAttribute('auths', default: [])['invalidateSessions'] ?? false;
if ($invalidate && !empty($current)) {
foreach ($sessions as $session) {
+2 -2
View File
@@ -718,7 +718,7 @@ trait TeamsBaseClient
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(4, $response['body']['total']);
$this->assertEquals(3, $response['body']['total']);
$ownerMembershipUid = $response['body']['memberships'][0]['$id'];
@@ -773,7 +773,7 @@ trait TeamsBaseClient
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(3, $response['body']['total']);
$this->assertEquals(2, $response['body']['total']);
/**
* Test for when the owner tries to delete their membership