Skip to content

Commit dbde90c

Browse files
committed
ACP2E-3992: Customer password reset through GraphQL doesn't honour the restrictions
1 parent a6933f3 commit dbde90c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/code/Magento/Security/Model/Plugin/AccountManagement.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2016 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -80,7 +80,8 @@ public function beforeInitiatePasswordReset(
8080
) {
8181
if ($this->scope->getCurrentScope() == Area::AREA_FRONTEND
8282
|| $this->passwordRequestEvent == PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST
83-
|| ($this->scope->getCurrentScope() == Area::AREA_WEBAPI_REST
83+
|| (($this->scope->getCurrentScope() == Area::AREA_WEBAPI_REST
84+
|| $this->scope->getCurrentScope() == Area::AREA_GRAPHQL)
8485
&& $this->passwordRequestEvent == PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST)) {
8586
$this->securityManager->performSecurityCheck(
8687
$this->passwordRequestEvent,

app/code/Magento/Security/Test/Unit/Model/Plugin/AccountManagementTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2016 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -120,6 +120,7 @@ public static function beforeInitiatePasswordResetDataProvider()
120120
// This should never happen, but let's cover it with tests
121121
[Area::AREA_FRONTEND, PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST, 1],
122122
[Area::AREA_WEBAPI_REST, PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST, 1],
123+
[Area::AREA_GRAPHQL, PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST, 1],
123124
];
124125
}
125126
}

0 commit comments

Comments
 (0)