#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck source=../lib/common.sh
source "${ROOT}/lib/common.sh"

require_env RESET_TOKEN
NEW_PASSWORD="${NEW_PASSWORD:-new-password-456}"

curl_post_json "/reset-password" \
  "$(printf '%s' "{\"newPassword\":\"${NEW_PASSWORD}\",\"token\":\"${RESET_TOKEN}\"}")" | pretty
