- 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>
29 lines
777 B
PHP
29 lines
777 B
PHP
<?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,
|
|
]);
|
|
}
|
|
}
|