Aniworld/src/tests/test_auth.ps1
Lukas Pupka-Lipinski 3f98dd6ebb Implement application setup and flow middleware
- Add SetupService for detecting application setup completion
- Create ApplicationFlowMiddleware to enforce setup  auth  main flow
- Add setup processing endpoints (/api/auth/setup, /api/auth/setup/status)
- Add Pydantic models for setup requests and responses
- Integrate middleware into FastAPI application
- Fix logging paths to use ./logs consistently
- All existing templates (setup.html, login.html) already working
2025-10-06 12:48:18 +02:00

14 lines
578 B
PowerShell

$loginResponse = Invoke-WebRequest -Uri "http://127.0.0.1:8000/auth/login" -Method POST -ContentType "application/json" -Body '{"password": "admin123"}'
$loginData = $loginResponse.Content | ConvertFrom-Json
$token = $loginData.token
Write-Host "Token: $token"
# Test the anime search with authentication
$headers = @{
"Authorization" = "Bearer $token"
"Content-Type" = "application/json"
}
$searchResponse = Invoke-WebRequest -Uri "http://127.0.0.1:8000/api/anime/search?query=naruto" -Headers $headers
Write-Host "Search Response:"
Write-Host $searchResponse.Content