Add ACP shell and JWT claims

This commit is contained in:
Micha
2025-12-24 13:29:28 +01:00
parent 193273c843
commit 5ed9d0e1f8
6 changed files with 166 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace App\EventSubscriber;
use App\Entity\User;
use Lexik\Bundle\JWTAuthenticationBundle\Event\JWTCreatedEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
#[AsEventListener(event: 'lexik_jwt_authentication.on_jwt_created')]
class JwtCreatedSubscriber
{
public function __invoke(JWTCreatedEvent $event): void
{
$user = $event->getUser();
if (!$user instanceof User) {
return;
}
$payload = $event->getData();
$payload['user_id'] = $user->getId();
$payload['username'] = $user->getUsername();
$event->setData($payload);
}
}

View File

@@ -164,3 +164,30 @@ msgstr "Registrierung läuft..."
msgid "form.create_account"
msgstr "Konto erstellen"
msgid "nav.acp"
msgstr "ACP"
msgid "acp.title"
msgstr "Administrationsbereich"
msgid "acp.no_access"
msgstr "Du hast keinen Zugriff auf diesen Bereich."
msgid "acp.general"
msgstr "Allgemein"
msgid "acp.general_hint"
msgstr "Globale Einstellungen und Board-Konfiguration erscheinen hier."
msgid "acp.forums"
msgstr "Foren"
msgid "acp.forums_hint"
msgstr "Kategorien und Foren in einer Baumansicht verwalten."
msgid "acp.users"
msgstr "Benutzer"
msgid "acp.users_hint"
msgstr "Werkzeuge zur Benutzerverwaltung erscheinen hier."

View File

@@ -164,3 +164,30 @@ msgstr "Registering..."
msgid "form.create_account"
msgstr "Create account"
msgid "nav.acp"
msgstr "ACP"
msgid "acp.title"
msgstr "Admin control panel"
msgid "acp.no_access"
msgstr "You do not have access to this area."
msgid "acp.general"
msgstr "General"
msgid "acp.general_hint"
msgstr "Global settings and board configuration will appear here."
msgid "acp.forums"
msgstr "Forums"
msgid "acp.forums_hint"
msgstr "Manage categories and forums from a tree view."
msgid "acp.users"
msgstr "Users"
msgid "acp.users_hint"
msgstr "User management tools will appear here."