Skip to content

Commit

Permalink
Merge pull request #1783 from SciPhi-AI/feature/fix-password-reset-js…
Browse files Browse the repository at this point in the history
…-sdk

Feature/fix password reset js sdk
  • Loading branch information
emrgnt-cmplxty authored Jan 8, 2025
2 parents eb2fa2a + 5965987 commit ae253f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion js/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "r2r-js",
"version": "0.4.11",
"version": "0.4.12",
"description": "",
"main": "dist/index.js",
"browser": "dist/index.browser.js",
Expand Down
28 changes: 19 additions & 9 deletions js/sdk/src/v3/clients/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,27 @@ export class UsersClient {
});
}

/**
* Request a password reset.
* @param email User's email address
* @returns
*/
// /**
// * Request a password reset.
// * @param email User's email address
// * @returns
// */
// @feature("users.requestPasswordReset")
// async requestPasswordReset(options: {
// email: string;
// }): Promise<WrappedGenericMessageResponse> {
// return this.client.makeRequest("POST", "users/request-password-reset", {
// data: options,
// });
// }

@feature("users.requestPasswordReset")
async requestPasswordReset(options: {
email: string;
}): Promise<WrappedGenericMessageResponse> {
async requestPasswordReset(email: string): Promise<WrappedGenericMessageResponse> {
return this.client.makeRequest("POST", "users/request-password-reset", {
data: options,
data: email, // Pass the raw string email
headers: {
"Content-Type": "text/plain", // Ensure headers specify plain text
},
});
}

Expand Down

0 comments on commit ae253f3

Please sign in to comment.