File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ class Authpost extends AbstractAction implements HttpPostActionInterface
93
93
* @param DataObjectFactory $dataObjectFactory
94
94
* @param UserResource $userResource
95
95
* @param ScopeConfigInterface $scopeConfig
96
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList)
96
97
*/
97
98
public function __construct (
98
99
Action \Context $ context ,
@@ -141,7 +142,7 @@ public function execute()
141
142
$ retries = $ this ->verifyRetryAttempts ();
142
143
if ($ retries > $ maxRetries ) { //locked the user
143
144
$ lockThreshold = $ this ->scopeConfig ->getValue (self ::XML_PATH_2FA_LOCK_EXPIRE );
144
- if ($ this ->userResource ->lock ($ user ->getId (),0 , $ lockThreshold )) {
145
+ if ($ this ->userResource ->lock ($ user ->getId (), 0 , $ lockThreshold )) {
145
146
$ result ->setData (['success ' => false , 'message ' => "User is disabled temporarily! " ]);
146
147
}
147
148
} else {
@@ -187,7 +188,7 @@ protected function _isAllowed()
187
188
private function verifyRetryAttempts () : int
188
189
{
189
190
$ verifyAttempts = $ this ->session ->getOtpAttempt ();
190
- $ verifyAttempts = is_null ( $ verifyAttempts) ? 0 : $ verifyAttempts +1 ;
191
+ $ verifyAttempts = $ verifyAttempts === null ? 1 : $ verifyAttempts +1 ;
191
192
$ this ->session ->setOtpAttempt ($ verifyAttempts );
192
193
return $ verifyAttempts ;
193
194
}
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ class Authpost extends AbstractAction implements HttpPostActionInterface
94
94
* @param DataObjectFactory $dataObjectFactory
95
95
* @param UserResource $userResource
96
96
* @param ScopeConfigInterface $scopeConfig
97
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList)
97
98
*/
98
99
public function __construct (
99
100
Action \Context $ context ,
@@ -135,7 +136,7 @@ public function execute()
135
136
$ retries = $ this ->verifyRetryAttempts ();
136
137
if ($ retries > $ maxRetries ) { //locked the user
137
138
$ lockThreshold = $ this ->scopeConfig ->getValue (self ::XML_PATH_2FA_LOCK_EXPIRE );
138
- if ($ this ->userResource ->lock ($ user ->getId (),0 , $ lockThreshold )) {
139
+ if ($ this ->userResource ->lock ($ user ->getId (), 0 , $ lockThreshold )) {
139
140
$ response ->setData (['success ' => false , 'message ' => "User is disabled temporarily! " ]);
140
141
}
141
142
} else {
@@ -179,7 +180,7 @@ protected function _isAllowed()
179
180
private function verifyRetryAttempts () : int
180
181
{
181
182
$ verifyAttempts = $ this ->session ->getOtpAttempt ();
182
- $ verifyAttempts = is_null ( $ verifyAttempts) ? 0 : $ verifyAttempts +1 ;
183
+ $ verifyAttempts = $ verifyAttempts === null ? 1 : $ verifyAttempts +1 ;
183
184
$ this ->session ->setOtpAttempt ($ verifyAttempts );
184
185
return $ verifyAttempts ;
185
186
}
Original file line number Diff line number Diff line change 34
34
showInDefault =" 1" showInWebsite =" 0" showInStore =" 0" >
35
35
<label >Configuration Email URL for Web API</label >
36
36
<comment >This can be used to override the default email configuration link that is sent when using the Magento Web API's to authenticate. Use the placeholder :tfat to indicate where the token should be injected</comment >
37
- </field >x
37
+ </field >
38
38
<field canRestore =" 1" id =" twofactorauth_retry" translate =" label" type =" text" sortOrder =" 40"
39
39
showInDefault =" 1" showInWebsite =" 0" showInStore =" 0" >
40
40
<label >Configuration for 2FA retry attempts</label >
You can’t perform that action at this time.
0 commit comments