-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
when attempting to use the 'cross_device' flow for password reset the body types are throwing a typescript error due to code_verifier being a required field which it is not in the cross_device flow, additionally user_id parameter is required in this flow and is not a typed attribute at all in this flow so suggest this also be added as optional to the parameters.
below is the error for a payload which looks like this
No overload matches this call.
Overload 1 of 2, '(options: { parameters?: { [x: `c_${string}`]: any; organizationId?: string; }; headers?: { [key: string]: string; }; body: PasswordActionVerifyRequest; }): Promise<void>', gave the following error.
Type '{ user_id: string; new_password: string; pwd_action_token: string; channel_id: string; client_id: string; hint: string; }' is not assignable to type 'PasswordActionVerifyRequest'.
Property 'code_verifier' is missing in type '{ user_id: string; new_password: string; pwd_action_token: string; channel_id: string; client_id: string; hint: string; }' but required in type '{ client_id: string; pwd_action_token: string; code_verifier: string; new_password?: string; channel_id: string; hint?: string; }'.
Overload 2 of 2, '(options: { parameters?: { [x: `c_${string}`]: any; organizationId?: string; }; headers?: { [key: string]: string; }; body: PasswordActionVerifyRequest; }, rawResponse?: boolean): Promise<...>', gave the following error.
Type '{ user_id: string; new_password: string; pwd_action_token: string; channel_id: string; client_id: string; hint: string; }' is not assignable to type 'PasswordActionVerifyRequest'.
Property 'code_verifier' is missing in type '{ user_id: string; new_password: string; pwd_action_token: string; channel_id: string; client_id: string; hint: string; }' but required in type '{ client_id: string; pwd_action_token: string; code_verifier: string; new_password?: string; channel_id: string; hint?: string; }'.sfcc documentation which documents this flow
https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-password-reset.html#slas-public-client
suggest type go from
type ShopperLoginTypes.PasswordActionVerifyRequest = {
client_id: string;
pwd_action_token: string;
code_verifier: string;
new_password?: string;
channel_id: string;
hint?: string;
} & {
[key: string]: any;
}to
type ShopperLoginTypes.PasswordActionVerifyRequest = {
client_id: string;
pwd_action_token: string;
code_verifier?: string;
new_password?: string;
channel_id: string;
user_id?: string
hint?: string;
} & {
[key: string]: any;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels