| 914 | } |
| 915 | |
| 916 | func (c *Client) RequestOneTimePasscode(ctx context.Context, req RequestOneTimePasscodeRequest) error { |
| 917 | res, err := c.Request(ctx, http.MethodPost, "/api/v2/users/otp/request", req) |
| 918 | if err != nil { |
| 919 | return err |
| 920 | } |
| 921 | defer res.Body.Close() |
| 922 | |
| 923 | if res.StatusCode != http.StatusNoContent { |
| 924 | return ReadBodyAsError(res) |
| 925 | } |
| 926 | |
| 927 | return nil |
| 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) |