Add ACP shell and JWT claims
This commit is contained in:
24
api/src/EventSubscriber/JwtCreatedSubscriber.php
Normal file
24
api/src/EventSubscriber/JwtCreatedSubscriber.php
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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."
|
||||
|
||||
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user