Skip to content

Commit d818b84

Browse files
authored
Merge wied03/ENG-2158/change-password (#62)
* add new overload case * fix comment capitalization
1 parent 7ff2be3 commit d818b84

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/FusionAuth/FusionAuthClient.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,37 @@ public function checkChangePasswordUsingJWT($encodedJWT)
292292
*
293293
* An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
294294
*
295-
* @param string $loginId The loginId of the User that you intend to change the password for.
295+
* @param string $loginId The loginId (email or username) of the User that you intend to change the password for.
296296
*
297297
* @return ClientResponse The ClientResponse.
298298
* @throws \Exception
299299
*/
300300
public function checkChangePasswordUsingLoginId($loginId)
301301
{
302302
return $this->start()->uri("/api/user/change-password")
303-
->urlParameter("username", $loginId)
303+
->urlParameter("loginId", $loginId)
304+
->get()
305+
->go();
306+
}
307+
308+
/**
309+
* Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
310+
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
311+
* your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
312+
*
313+
* An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
314+
*
315+
* @param string $loginId The loginId of the User that you intend to change the password for.
316+
* @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to.
317+
*
318+
* @return ClientResponse The ClientResponse.
319+
* @throws \Exception
320+
*/
321+
public function checkChangePasswordUsingLoginIdAndLoginIdTypes($loginId, $loginIdTypes)
322+
{
323+
return $this->start()->uri("/api/user/change-password")
324+
->urlParameter("loginId", $loginId)
325+
->urlParameter("loginIdTypes", $loginIdTypes)
304326
->get()
305327
->go();
306328
}
@@ -4439,7 +4461,7 @@ public function retrieveUserByLoginId($loginId)
44394461
* Retrieves the user for the loginId, using specific loginIdTypes.
44404462
*
44414463
* @param string $loginId The email or username of the user.
4442-
* @param array $loginIdTypes the identity types that FusionAuth will compare the loginId to.
4464+
* @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to.
44434465
*
44444466
* @return ClientResponse The ClientResponse.
44454467
* @throws \Exception
@@ -4690,7 +4712,7 @@ public function retrieveUserLoginReportByLoginId($applicationId, $loginId, $star
46904712
* @param string $loginId The userId id.
46914713
* @param array $start The start instant as UTC milliseconds since Epoch.
46924714
* @param array $end The end instant as UTC milliseconds since Epoch.
4693-
* @param array $loginIdTypes the identity types that FusionAuth will compare the loginId to.
4715+
* @param array $loginIdTypes The identity types that FusionAuth will compare the loginId to.
46944716
*
46954717
* @return ClientResponse The ClientResponse.
46964718
* @throws \Exception

0 commit comments

Comments
 (0)