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()
120120 ScopeInterface::SCOPE_STORE
121121 )
122122 && !$ this ->customerSession ->getNoReferer ()
123+ && $ this ->request ->isGet ()
123124 ) {
124125 $ referer = $ this ->urlBuilder ->getUrl ('*/*/* ' , ['_current ' => true , '_use_rewrite ' => true ]);
125126 $ referer = $ this ->urlEncoder ->encode ($ referer );
Original file line number Diff line number Diff line change @@ -144,6 +144,25 @@ public function testLoginWithRedirectToDashboardDisabled(): void
144144 $ this ->assertRedirect ($ this ->stringContains ('test_redirect ' ));
145145 }
146146
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+
147166 /**
148167 * @magentoConfigFixture current_store customer/startup/redirect_dashboard 0
149168 * @magentoConfigFixture current_store customer/captcha/enable 0
You can’t perform that action at this time.
0 commit comments