Fix PHP refference bug

This commit is contained in:
Matej Bačo
2024-01-05 12:07:41 +01:00
parent ba32170f72
commit 0a2be34ceb
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -119,7 +119,7 @@ App::post('/v1/account')
}
}
$hooks->trigger('passwordValidator', [$project, $password, $user]);
$hooks->trigger('passwordValidator', [$project, $password, &$user]);
$passwordHistory = $project->getAttribute('auths', [])['passwordHistory'] ?? 0;
$password = Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS);
@@ -1915,7 +1915,7 @@ App::patch('/v1/account/password')
}
}
$hooks->trigger('passwordValidator', [$project, $password, $user]);
$hooks->trigger('passwordValidator', [$project, $password, &$user]);
$user
->setAttribute('password', $newPassword)
+2 -2
View File
@@ -99,7 +99,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e
'search' => implode(' ', [$userId, $email, $phone, $name]),
]);
$hooks->trigger('passwordValidator', [$project, $password, $user]);
$hooks->trigger('passwordValidator', [$project, $password, &$user]);
$password = (!empty($password)) ? ($hash === 'plaintext' ? Auth::passwordHash($password, $hash, $hashOptionsObject) : $password) : null;
$user = $dbForProject->createDocument('users', $user);
@@ -875,7 +875,7 @@ App::patch('/v1/users/:userId/password')
}
}
$hooks->trigger('passwordValidator', [$project, $password, $user]);
$hooks->trigger('passwordValidator', [$project, $password, &$user]);
$newPassword = Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS);