From d6d52e5e957ad16a76428e9e314336b49a64eb72 Mon Sep 17 00:00:00 2001 From: BahmanMD Date: Wed, 20 Oct 2021 12:43:28 +0330 Subject: [PATCH] [Security] Update security.rst All deleted and added texts are displayed in the main text of the site. --- security.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/security.rst b/security.rst index e1e1b106656..d72c279a689 100644 --- a/security.rst +++ b/security.rst @@ -1067,7 +1067,6 @@ token (or whatever you need to return) and return the JSON response: class ApiLoginController extends AbstractController { #[Route('/api/login', name: 'api_login')] - - public function index(): Response + public function index(#[CurrentUser] ?User $user): Response { + if (null === $user) { @@ -1079,8 +1078,6 @@ token (or whatever you need to return) and return the JSON response: + $token = ...; // somehow create an API token for $user + return $this->json([ - - 'message' => 'Welcome to your new controller!', - - 'path' => 'src/Controller/ApiLoginController.php', + 'user' => $user->getUserIdentifier(), + 'token' => $token, ]);