reset-password
Method: POST
Path: /auth/reset-password
Tags: Auth
Summary
Reset password
Description
Reset password
Storefront SDK Usage
SDK Method: sdk.auth.resetPassword()
Example:
typescript
// Reset password with OTP token from forgot password flow
const { data, error } = await sdk.auth.resetPassword({
new_password: "newSecurePassword123",
confirm_password: "newSecurePassword123",
otp_token: "abc123otptoken"
});
if (error) {
console.error("Password reset failed:", error.message);
} else {
console.log("Password reset successful");
console.log("New access token:", data.access_token);
}TypeScript Definition
typescript
"reset-password": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description The new password that the user wants to set for their account. */
new_password: string;
/** @description A confirmation of the new password. */
confirm_password: string;
/** @description A string representing the OTP token which facilitas the resetting of user’s account password. */
otp_token: string;
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
/** @description A descriptive message confirming the success or failure of the reset password operation. */
message: string;
/** @description Indicates whether the request was successful or failure (true for success, false for failure). */
success: boolean;
/** @description An object containing the response content. */
content: {
/** @description It is a string-based token utilized for authentication and authorization. */
access_token: string;
/** @description It is a string-based token designed for refreshing the user's access token. */
refresh_token: string;
};
};
};
};
400: components["responses"]["BadRequest"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["responses"]["BadRequest"] | BadRequest |
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
OpenAPI Definition
json
{
"tags": [
"Auth"
],
"operationId": "reset-password",
"summary": "Reset password",
"description": "Reset password",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/reset-password",
"description": "API reference for the reset-password operation"
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"new_password",
"confirm_password",
"otp_token"
],
"properties": {
"new_password": {
"description": "The new password that the user wants to set for their account.",
"type": "string"
},
"confirm_password": {
"description": "A confirmation of the new password.",
"type": "string"
},
"otp_token": {
"description": "A string representing the OTP token which facilitas the resetting of user’s account password.",
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"description": "A descriptive message confirming the success or failure of the reset password operation.",
"type": "string"
},
"success": {
"description": "Indicates whether the request was successful or failure (true for success, false for failure).",
"type": "boolean"
},
"content": {
"description": "An object containing the response content.",
"properties": {
"access_token": {
"description": "It is a string-based token utilized for authentication and authorization.",
"type": "string"
},
"refresh_token": {
"description": "It is a string-based token designed for refreshing the user's access token.",
"type": "string"
}
},
"required": [
"access_token",
"refresh_token"
],
"type": "object"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "auth",
"x-speakeasy-ignore": true,
"x-speakeasy-name-override": "resetPassword"
}Auto-generated from OpenAPI spec and TypeScript definitions