adasdsa
This commit is contained in:
@@ -6,6 +6,7 @@ require_once dirname(__DIR__) . '/src/App/bootstrap.php';
|
||||
|
||||
use App\App;
|
||||
use App\AccountGate;
|
||||
use App\AuthStatusRedirect;
|
||||
use App\ConfigLoader;
|
||||
use App\KeycloakAuth;
|
||||
|
||||
@@ -17,6 +18,15 @@ $registrationConfig = ConfigLoader::load($projectRoot, 'registration');
|
||||
$auth = new KeycloakAuth($keycloakConfig);
|
||||
$accountGate = new AccountGate($registrationConfig);
|
||||
|
||||
if (!$auth->isAuthenticated()) {
|
||||
$statusRedirect = AuthStatusRedirect::consume();
|
||||
|
||||
if ($statusRedirect !== null) {
|
||||
header('Location: ' . $statusRedirect, true, 302);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($auth->isAuthenticated()) {
|
||||
$currentUser = is_array($_SESSION['desktop_auth']['user'] ?? null) ? $_SESSION['desktop_auth']['user'] : [];
|
||||
$accountCheck = $accountGate->checkUsername((string) ($currentUser['username'] ?? ''));
|
||||
|
||||
Reference in New Issue
Block a user