#!/usr/bin/env bash
#
# Thin wrapper around scripts/gen-jwt.py that generates HS256 anon +
# service_role JWTs for a given JWT_SECRET. The keys are 10-year, iss=supabase.
#
# Usage:
#   ./scripts/prod/gen-jwt.sh <jwt-secret>

set -euo pipefail

here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
repo_root="$(cd "${here}/../.." && pwd)"

secret="${1:-}"
if [[ -z "${secret}" ]]; then
  echo "usage: $0 <jwt-secret>" >&2
  exit 1
fi

python3 "${repo_root}/scripts/gen-jwt.py" "${secret}"
