Security: interruption du traitement si pas d'utilisateur authentifié
This commit is contained in:
parent
325d986505
commit
a311d67f39
|
@ -4,8 +4,8 @@ namespace App\Controller;
|
||||||
use App\Http\DataResponse;
|
use App\Http\DataResponse;
|
||||||
use App\Http\ErrorResponse;
|
use App\Http\ErrorResponse;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
class SecurityController extends Controller
|
class SecurityController extends Controller
|
||||||
|
@ -18,12 +18,7 @@ class SecurityController extends Controller
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
if ($user == null) {
|
if ($user == null) {
|
||||||
return new ErrorResponse(
|
return null;
|
||||||
0,
|
|
||||||
"Identifiants invalides",
|
|
||||||
null,
|
|
||||||
401,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DataResponse([
|
return new DataResponse([
|
||||||
|
|
Loading…
Reference in New Issue