json([ 'error' => 'Invalid credentials' ], 401); } return new Response(null, 204, [ 'Location' => $iriConverter->getIriFromResource($user), ]); } /** * @throws Exception */ #[Route('/logout', name: 'app_logout', methods: ['GET'])] public function logout(): void { throw new Exception('This method can be blank.'); } }