I currently have a login form which opens when a customer clicks a link in the header (instead of going off to /customer/login). Apart from a few field ID's, it's pretty much unchanged from customer/templates/form/login.phtml.
How do I call the current url into the form so it doesn't redirect to the account page? (I have disabled that feature in the CMS also)
I know from various tutorials this can be achieved using this as url:
$url = $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]); $login_url = $block->getUrl('customer/account/login', array('referer' => base64_encode($url)));
But I'm not quite sure how to integrate that into the custom form.