M0: Skelett + Auth-Grundgerüst (Keycloak-OIDC + API-Token)
- Symfony 7.4 LTS, PHP 8.4, FrankenPHP, SQLite (3-Layer src/UI|Logic|Data) - Auth: manueller OidcClient (Authorization-Code) im UI-Layer, kein Security-Bundle/league; Session-Gate via SessionAuthSubscriber - API-Guard via statischem X-Api-Token (ApiTokenSubscriber); ExceptionSubscriber - UserEntity (Auto-Provision) + Init-Migration - Docker (php:8.4-frankenphp) + compose (essen.ljh31.de, traefik-net external) - SmokeTests (7) grün: Redirect-Fälle, API-Token, Auth-Render, Logout Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\UI\Http;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class HomeController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* GET / — Hello-World-Statusseite (M0).
|
||||
*/
|
||||
public function index(Request $request, string $redirect = '/'): Response
|
||||
{
|
||||
$session = $request->getSession();
|
||||
$name = (string) $session->get('auth_name', '');
|
||||
$email = (string) $session->get('auth_email', '');
|
||||
|
||||
return $this->render('home/index.html.twig', [
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'redirect' => $redirect === '' ? '/' : $redirect,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user