From c5420cf9826f7190fe0d639cb1ef4f5cf4de3345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFck=20Piera?= Date: Sun, 31 Oct 2021 22:35:50 +0100 Subject: [PATCH] Fix Response HTTP constant --- security.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security.rst b/security.rst index 8d55515b692..86d4e9a6fa0 100644 --- a/security.rst +++ b/security.rst @@ -1073,7 +1073,7 @@ token (or whatever you need to return) and return the JSON response: + if (null === $user) { + return $this->json([ + 'message' => 'missing credentials', - + ], Response::HTTP_UNAUTHENTICATED); + + ], Response::HTTP_UNAUTHORIZED); + } + + $token = ...; // somehow create an API token for $user