normogen/backend/quick-test.sh
goose 378703bf1c
Some checks failed
Lint and Build / Lint (push) Failing after 13m48s
Lint and Build / Build (push) Has been skipped
Lint and Build / Docker Build (push) Has been skipped
docs(phase-2.5): Complete access control implementation
2026-02-15 21:15:17 -03:00

33 lines
964 B
Bash
Executable file

#!/bin/bash
# Quick API Test for Normogen Backend
# Updated for port 6500
echo "🧪 Quick API Test - Normogen Backend"
echo "===================================="
echo ""
echo "1. Health Check..."
curl -s http://10.0.10.30:6500/health | jq .
echo ""
echo "2. Login Test..."
RESPONSE=$(curl -s -X POST http://10.0.10.30:6500/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "recoverytest@example.com", "password": "NewSecurePassword456!"}')
echo "$RESPONSE" | jq .
# Extract token
TOKEN=$(echo "$RESPONSE" | jq -r '.access_token // .access_token // empty')
echo ""
if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ]; then
echo "3. Protected Endpoint (with token)..."
curl -s -X GET http://10.0.10.30:6500/api/users/me \
-H "Authorization: Bearer $TOKEN" | jq .
else
echo "3. Protected Endpoint (no token - should fail)..."
curl -s -X GET http://10.0.10.30:6500/api/users/me | jq .
fi
echo ""
echo "✅ Test complete!"