File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
app/code/Magento/Customer/Model
dev/tests/integration/testsuite/Magento/Customer/Controller/Account Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ public function getLoginUrlParams()
120
120
ScopeInterface::SCOPE_STORE
121
121
)
122
122
&& !$ this ->customerSession ->getNoReferer ()
123
+ && $ this ->request ->isGet ()
123
124
) {
124
125
$ referer = $ this ->urlBuilder ->getUrl ('*/*/* ' , ['_current ' => true , '_use_rewrite ' => true ]);
125
126
$ referer = $ this ->urlEncoder ->encode ($ referer );
Original file line number Diff line number Diff line change @@ -144,6 +144,25 @@ public function testLoginWithRedirectToDashboardDisabled(): void
144
144
$ this ->assertRedirect ($ this ->stringContains ('test_redirect ' ));
145
145
}
146
146
147
+ /**
148
+ * @magentoConfigFixture current_store customer/startup/redirect_dashboard 0
149
+ * @magentoConfigFixture current_store customer/captcha/enable 0
150
+ *
151
+ * @magentoDataFixture Magento/Customer/_files/customer.php
152
+ *
153
+ * @return void
154
+ */
155
+ public function testLoginFailureWithRedirectToDashboardDisabled (): void
156
+ {
157
+ $ this ->prepareRequest ('customer@example.com ' , 'incorrect ' );
158
+ $ this ->dispatch ('customer/account/loginPost ' );
159
+ $ this ->assertFalse ($ this ->session ->isLoggedIn ());
160
+ $ this ->assertRedirect ($ this ->logicalAnd (
161
+ $ this ->stringContains ('customer/account/login ' ),
162
+ $ this ->logicalnot ($ this ->stringContains ('referer ' ))
163
+ ));
164
+ }
165
+
147
166
/**
148
167
* @magentoConfigFixture current_store customer/startup/redirect_dashboard 0
149
168
* @magentoConfigFixture current_store customer/captcha/enable 0
You can’t perform that action at this time.
0 commit comments