Skip to content

Commit a806201

Browse files
authored
remove user data from login responses (#1479)
1 parent a3e8a01 commit a806201

2 files changed

Lines changed: 10 additions & 30 deletions

File tree

src/Authorization/Controller/LoginController.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,15 @@
1313

1414
namespace Pimcore\Bundle\StudioBackendBundle\Authorization\Controller;
1515

16-
use OpenApi\Attributes\JsonContent;
1716
use OpenApi\Attributes\Post;
1817
use Pimcore\Bundle\StudioBackendBundle\Authorization\Attribute\Request\CredentialsRequestBody;
1918
use Pimcore\Bundle\StudioBackendBundle\Authorization\Attribute\Response\InvalidCredentialsResponse;
2019
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
2120
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\DefaultResponses;
2221
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\SuccessResponse;
2322
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags;
24-
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Schema\UserInformation;
25-
use Pimcore\Bundle\StudioBackendBundle\User\Service\UserInformationServiceInterface;
26-
use Pimcore\Security\User\User;
27-
use Symfony\Component\HttpFoundation\JsonResponse;
23+
use Symfony\Component\HttpFoundation\Response;
2824
use Symfony\Component\Routing\Attribute\Route;
29-
use Symfony\Component\Security\Http\Attribute\CurrentUser;
3025

3126
/**
3227
* @internal
@@ -43,17 +38,12 @@ final class LoginController extends AbstractApiController
4338
)]
4439
#[CredentialsRequestBody]
4540
#[SuccessResponse(
46-
description: 'login_success_response',
47-
content: new JsonContent(ref: UserInformation::class)
41+
description: 'login_success_response'
4842
)]
4943
#[InvalidCredentialsResponse]
5044
#[DefaultResponses]
51-
public function login(
52-
#[CurrentUser] User $user,
53-
UserInformationServiceInterface $userInformationService
54-
): JsonResponse {
55-
return $this->jsonResponse(
56-
$userInformationService->getUserInformation($user->getUser())
57-
);
45+
public function login(): Response
46+
{
47+
return new Response();
5848
}
5949
}

src/Authorization/Controller/TokenLoginController.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,15 @@
1313

1414
namespace Pimcore\Bundle\StudioBackendBundle\Authorization\Controller;
1515

16-
use OpenApi\Attributes\JsonContent;
1716
use OpenApi\Attributes\Post;
1817
use Pimcore\Bundle\StudioBackendBundle\Authorization\Attribute\Request\TokenRequestBody;
1918
use Pimcore\Bundle\StudioBackendBundle\Authorization\Attribute\Response\InvalidCredentialsResponse;
2019
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
2120
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\DefaultResponses;
2221
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\SuccessResponse;
2322
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags;
24-
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Schema\UserInformation;
25-
use Pimcore\Bundle\StudioBackendBundle\User\Service\UserInformationServiceInterface;
26-
use Pimcore\Security\User\User;
27-
use Symfony\Component\HttpFoundation\JsonResponse;
23+
use Symfony\Component\HttpFoundation\Response;
2824
use Symfony\Component\Routing\Attribute\Route;
29-
use Symfony\Component\Security\Http\Attribute\CurrentUser;
3025

3126
/**
3227
* @internal
@@ -47,17 +42,12 @@ final class TokenLoginController extends AbstractApiController
4742
)]
4843
#[TokenRequestBody]
4944
#[SuccessResponse(
50-
description: 'login_token_success_response',
51-
content: new JsonContent(ref: UserInformation::class)
45+
description: 'login_token_success_response'
5246
)]
5347
#[InvalidCredentialsResponse]
5448
#[DefaultResponses]
55-
public function tokenLogin(
56-
#[CurrentUser] User $user,
57-
UserInformationServiceInterface $userInformationService
58-
): JsonResponse {
59-
return $this->jsonResponse(
60-
$userInformationService->getUserInformation($user->getUser())
61-
);
49+
public function tokenLogin(): Response
50+
{
51+
return new Response();
6252
}
6353
}

0 commit comments

Comments
 (0)