cleanup: Remove test files
- Remove test_auth.php and test_auth_middleware.php - These were temporary debugging files
This commit is contained in:
1 parent
f75573768c
commit
c4189cefa7
2 files changed
-63
No files matched your search
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
// Teste simples de autenticação
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// Load environment
|
||||
\App\Core\EnvironmentLoader::load();
|
||||
|
||||
// Initialize database
|
||||
$db = \App\Core\DatabaseManager::getInstance();
|
||||
|
||||
// Test Auth class
|
||||
try {
|
||||
$auth = new \App\Core\Auth();
|
||||
echo "Auth class loaded successfully\n";
|
||||
|
||||
// Check if user is logged in
|
||||
$isLoggedIn = $auth->check();
|
||||
echo "User logged in: " . ($isLoggedIn ? 'Yes' : 'No') . "\n";
|
||||
|
||||
if ($isLoggedIn) {
|
||||
echo "User ID: " . $auth->id() . "\n";
|
||||
echo "Is Admin: " . ($auth->isAdmin() ? 'Yes' : 'No') . "\n";
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "Error with Auth: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
// Test UserModel
|
||||
try {
|
||||
$userModel = new \App\Modules\Users\Models\UserModel();
|
||||
$users = $userModel->getAllForAdmin('', 'name', 1, 5);
|
||||
echo "Users found: " . count($users) . "\n";
|
||||
|
||||
foreach ($users as $user) {
|
||||
echo "- ID: {$user['id']}, Name: {$user['first_name']} {$user['last_name']}, Email: {$user['email']}\n";
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "Error with UserModel: " . $e->getMessage() . "\n";
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
// Teste do AuthMiddleware
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
// Load environment
|
||||
\App\Core\EnvironmentLoader::load();
|
||||
|
||||
// Simular Authorization header
|
||||
$_SERVER['HTTP_AUTHORIZATION'] = 'Bearer mf_redirect_2025';
|
||||
|
||||
echo "Testing AuthMiddleware::apiOrAuth()\n";
|
||||
echo "REDIRECTS_API_KEY: " . ($_ENV['REDIRECTS_API_KEY'] ?? 'NOT_FOUND') . "\n";
|
||||
echo "Auth::check(): " . (\App\Core\Auth::check() ? 'true' : 'false') . "\n";
|
||||
echo "Authorization header: " . ($_SERVER['HTTP_AUTHORIZATION'] ?? 'NOT_FOUND') . "\n";
|
||||
|
||||
// Test apiOrAuth
|
||||
try {
|
||||
\App\Core\AuthMiddleware::apiOrAuth();
|
||||
echo "apiOrAuth: PASSED\n";
|
||||
} catch (Exception $e) {
|
||||
echo "apiOrAuth: FAILED - " . $e->getMessage() . "\n";
|
||||
}
|
||||
Reference in new issue
Block a user