#!/bin/bash
BASE="http://localhost:8055"
TOKEN=$(curl -s -X POST "$BASE/auth/login" -H "Content-Type: application/json" \
  -d '{"email":"admin@deusens.com","password":"Admin1234!"}' | jq -r '.data.access_token')
KIOSK_TOKEN=$(openssl rand -hex 32)
curl -s -X POST "$BASE/users" -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"email\":\"kiosk@zaragoza.es\",\"password\":\"$(openssl rand -hex 16)\",\"token\":\"$KIOSK_TOKEN\"}" > /dev/null
echo "Kiosk token: VITE_CMS_TOKEN=$KIOSK_TOKEN"
