Skip to content

Commit 7c32f04

Browse files
committed
add new overload case
1 parent 8268700 commit 7c32f04

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

pkg/fusionauth/Client.go

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ func (c *FusionAuthClient) CheckChangePasswordUsingJWTWithContext(ctx context.Co
559559
//
560560
// 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.
561561
//
562-
// string loginId The loginId of the User that you intend to change the password for.
562+
// string loginId The loginId (email or username) of the User that you intend to change the password for.
563563
func (c *FusionAuthClient) CheckChangePasswordUsingLoginId(loginId string) (*BaseHTTPResponse, *Errors, error) {
564564
return c.CheckChangePasswordUsingLoginIdWithContext(context.TODO(), loginId)
565565
}
@@ -571,14 +571,52 @@ func (c *FusionAuthClient) CheckChangePasswordUsingLoginId(loginId string) (*Bas
571571
//
572572
// 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.
573573
//
574-
// string loginId The loginId of the User that you intend to change the password for.
574+
// string loginId The loginId (email or username) of the User that you intend to change the password for.
575575
func (c *FusionAuthClient) CheckChangePasswordUsingLoginIdWithContext(ctx context.Context, loginId string) (*BaseHTTPResponse, *Errors, error) {
576576
var resp BaseHTTPResponse
577577
var errors Errors
578578

579579
restClient := c.Start(&resp, &errors)
580580
err := restClient.WithUri("/api/user/change-password").
581-
WithParameter("username", loginId).
581+
WithParameter("loginId", loginId).
582+
WithMethod(http.MethodGet).
583+
Do(ctx)
584+
if restClient.ErrorRef == nil {
585+
return &resp, nil, err
586+
}
587+
return &resp, &errors, err
588+
}
589+
590+
// CheckChangePasswordUsingLoginIdAndLoginIdTypes
591+
// Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
592+
// When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
593+
// your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
594+
//
595+
// 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.
596+
//
597+
// string loginId The loginId of the User that you intend to change the password for.
598+
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to.
599+
func (c *FusionAuthClient) CheckChangePasswordUsingLoginIdAndLoginIdTypes(loginId string, loginIdTypes []string) (*BaseHTTPResponse, *Errors, error) {
600+
return c.CheckChangePasswordUsingLoginIdAndLoginIdTypesWithContext(context.TODO(), loginId, loginIdTypes)
601+
}
602+
603+
// CheckChangePasswordUsingLoginIdAndLoginIdTypesWithContext
604+
// Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
605+
// When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
606+
// your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
607+
//
608+
// 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.
609+
//
610+
// string loginId The loginId of the User that you intend to change the password for.
611+
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to.
612+
func (c *FusionAuthClient) CheckChangePasswordUsingLoginIdAndLoginIdTypesWithContext(ctx context.Context, loginId string, loginIdTypes []string) (*BaseHTTPResponse, *Errors, error) {
613+
var resp BaseHTTPResponse
614+
var errors Errors
615+
616+
restClient := c.Start(&resp, &errors)
617+
err := restClient.WithUri("/api/user/change-password").
618+
WithParameter("loginId", loginId).
619+
WithParameter("loginIdTypes", loginIdTypes).
582620
WithMethod(http.MethodGet).
583621
Do(ctx)
584622
if restClient.ErrorRef == nil {

0 commit comments

Comments
 (0)