@delopay/sdk 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2069,8 +2069,21 @@ var Users = class {
2069
2069
  async forgotPassword(params) {
2070
2070
  return this.request("POST", "/user/forgot_password", { body: params });
2071
2071
  }
2072
+ /**
2073
+ * Reset a user's password using the single-purpose JWT delivered by the
2074
+ * forgot-password email.
2075
+ *
2076
+ * The backend's `SinglePurposeJWTAuth` reads the token from the
2077
+ * `Authorization: Bearer …` header, not from the request body, so the
2078
+ * SDK lifts the `token` field out of `params` and sends it as the header.
2079
+ * Callers still pass `{ password, token }` — the shape is unchanged.
2080
+ */
2072
2081
  async resetPassword(params) {
2073
- return this.request("POST", "/user/reset_password", { body: params });
2082
+ const { token, password } = params;
2083
+ return this.request("POST", "/user/reset_password", {
2084
+ body: { password },
2085
+ headers: { Authorization: `Bearer ${token}` }
2086
+ });
2074
2087
  }
2075
2088
  async verifyEmail(params) {
2076
2089
  return this.request("POST", "/user/verify_email", { body: params });