Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
2 added 581 characters in body
source | link

You do it in you controller, action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>" is a controller post url, this url is set in your that module block.

When you post your form, the controller get that form params then it do some stuff and it redirect at the end, So you go to that controller then you change the url where you want to redirect after fail or success.

To get the controller url, you have to go the block module then you check getPostActionUrl(), or in console browser network (appear when submit a form).

Update :

1) The code :

if (!$this->getScopeConfig()->getValue('customer/startup/redirect_dashboard') && $redirectRoute) {
            $response['redirectUrl'] = $this->_redirect->success($redirectRoute);
            $this->getAccountRedirect()->clearRedirectCookie();
        } 

mean :

If you haven't set a value in admin config : customer/startup/redirect_dashboard, it will redirect to the $redirectRoute Url.

2) Don't update vendor/magento/module-customer/..., you have to rewrite this controller or do an observer for that.

You do it in you controller, action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>" is a controller post url, this url is set in your that module block.

When you post your form, the controller get that form params then it do some stuff and it redirect at the end, So you go to that controller then you change the url where you want to redirect after fail or success.

To get the controller url, you have to go the block module then you check getPostActionUrl(), or in console browser network (appear when submit a form).

You do it in you controller, action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>" is a controller post url, this url is set in your that module block.

When you post your form, the controller get that form params then it do some stuff and it redirect at the end, So you go to that controller then you change the url where you want to redirect after fail or success.

To get the controller url, you have to go the block module then you check getPostActionUrl(), or in console browser network (appear when submit a form).

Update :

1) The code :

if (!$this->getScopeConfig()->getValue('customer/startup/redirect_dashboard') && $redirectRoute) {
            $response['redirectUrl'] = $this->_redirect->success($redirectRoute);
            $this->getAccountRedirect()->clearRedirectCookie();
        } 

mean :

If you haven't set a value in admin config : customer/startup/redirect_dashboard, it will redirect to the $redirectRoute Url.

2) Don't update vendor/magento/module-customer/..., you have to rewrite this controller or do an observer for that.

1
source | link

You do it in you controller, action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>" is a controller post url, this url is set in your that module block.

When you post your form, the controller get that form params then it do some stuff and it redirect at the end, So you go to that controller then you change the url where you want to redirect after fail or success.

To get the controller url, you have to go the block module then you check getPostActionUrl(), or in console browser network (appear when submit a form).