| 928 | } |
| 929 | |
| 930 | func (c *Client) ChangePasswordWithOneTimePasscode(ctx context.Context, req ChangePasswordWithOneTimePasscodeRequest) error { |
| 931 | res, err := c.Request(ctx, http.MethodPost, "/api/v2/users/otp/change-password", req) |
| 932 | if err != nil { |
| 933 | return err |
| 934 | } |
| 935 | defer res.Body.Close() |
| 936 | |
| 937 | if res.StatusCode != http.StatusNoContent { |
| 938 | return ReadBodyAsError(res) |
| 939 | } |
| 940 | |
| 941 | return nil |
| 942 | } |
| 943 | |
| 944 | // ConvertLoginType will send a request to convert the user from password |
| 945 | // based authentication to oauth based. The response has the oauth state code |