Skip to content
On this page

useCustomerPassword

Definition

Composable for customer password management.

Basic usage

ts
const { 
 errors,
 updatePassword,
 resetPassword 
} = useCustomerPassword();

Signature

ts
export function useCustomerPassword(): UseCustomerPasswordReturn 

Return type

See UseCustomerPasswordReturn
ts
export type UseCustomerPasswordReturn = {
  errors: UnwrapRef<{
    resetPassword: ShopwareError[];
    updatePassword: ShopwareError[];
  }>;
  /**
   * Change customer's current password
   */
  updatePassword(
    updatePasswordData: CustomerUpdatePasswordParam,
  ): Promise<boolean>;
  /**
   * Reset customer's password
   */
  resetPassword(
    resetPasswordData: CustomerResetPasswordParam,
  ): Promise<boolean>;
};

Properties

NameTypeDescription
errors
UnwrapRef<{
    resetPassword: ShopwareError[];
    updatePassword: ShopwareError[];
  }>

Methods

NameTypeDescription
updatePassword
Promise<boolean>
Change customer's current password
resetPassword
Promise<boolean>
Reset customer's password
useCustomerPassword has loaded