import { noop } from "../../util"; import { cognitoFetch } from "../cognito-fetch"; type TChangePasswordParams = { region: string; accessToken: string; previousPassword?: string; proposedPassword: string; debug?: (trace: any) => void; }; export const changePassword = async ({ region, accessToken, previousPassword, proposedPassword, debug = noop, }: TChangePasswordParams) => await cognitoFetch({ region, operation: "ChangePassword", args: { AccessToken: accessToken, ...(previousPassword ? { PreviousPassword: previousPassword } : {}), ProposedPassword: proposedPassword, }, debug, });