Skip to content

Commit 5a42ea7

Browse files
authored
Merge wied03/ENG-2158/change-password (#159)
* add new overload case * fix comment capitalization
1 parent 8268700 commit 5a42ea7

File tree

1 file changed

+45
-7
lines changed

1 file changed

+45
-7
lines changed

pkg/fusionauth/Client.go

Lines changed: 45 additions & 7 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 {
@@ -7088,7 +7126,7 @@ func (c *FusionAuthClient) RetrieveUserByLoginIdWithContext(ctx context.Context,
70887126
// Retrieves the user for the loginId, using specific loginIdTypes.
70897127
//
70907128
// string loginId The email or username of the user.
7091-
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to.
7129+
// []string loginIdTypes The identity types that FusionAuth will compare the loginId to.
70927130
func (c *FusionAuthClient) RetrieveUserByLoginIdWithLoginIdTypes(loginId string, loginIdTypes []string) (*UserResponse, *Errors, error) {
70937131
return c.RetrieveUserByLoginIdWithLoginIdTypesWithContext(context.TODO(), loginId, loginIdTypes)
70947132
}
@@ -7097,7 +7135,7 @@ func (c *FusionAuthClient) RetrieveUserByLoginIdWithLoginIdTypes(loginId string,
70977135
// Retrieves the user for the loginId, using specific loginIdTypes.
70987136
//
70997137
// string loginId The email or username of the user.
7100-
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to.
7138+
// []string loginIdTypes The identity types that FusionAuth will compare the loginId to.
71017139
func (c *FusionAuthClient) RetrieveUserByLoginIdWithLoginIdTypesWithContext(ctx context.Context, loginId string, loginIdTypes []string) (*UserResponse, *Errors, error) {
71027140
var resp UserResponse
71037141
var errors Errors
@@ -7458,7 +7496,7 @@ func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdWithContext(ctx conte
74587496
// string loginId The userId id.
74597497
// int64 start The start instant as UTC milliseconds since Epoch.
74607498
// int64 end The end instant as UTC milliseconds since Epoch.
7461-
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to.
7499+
// []string loginIdTypes The identity types that FusionAuth will compare the loginId to.
74627500
func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdAndLoginIdTypes(applicationId string, loginId string, start int64, end int64, loginIdTypes []string) (*LoginReportResponse, *Errors, error) {
74637501
return c.RetrieveUserLoginReportByLoginIdAndLoginIdTypesWithContext(context.TODO(), applicationId, loginId, start, end, loginIdTypes)
74647502
}
@@ -7471,7 +7509,7 @@ func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdAndLoginIdTypes(appli
74717509
// string loginId The userId id.
74727510
// int64 start The start instant as UTC milliseconds since Epoch.
74737511
// int64 end The end instant as UTC milliseconds since Epoch.
7474-
// []string loginIdTypes the identity types that FusionAuth will compare the loginId to.
7512+
// []string loginIdTypes The identity types that FusionAuth will compare the loginId to.
74757513
func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdAndLoginIdTypesWithContext(ctx context.Context, applicationId string, loginId string, start int64, end int64, loginIdTypes []string) (*LoginReportResponse, *Errors, error) {
74767514
var resp LoginReportResponse
74777515
var errors Errors

0 commit comments

Comments
 (0)