diff --git a/core/modules/user/src/Plugin/Block/UserLoginBlock.php b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
index 350a19e..ce2a28d 100644
--- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php
+++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
@@ -44,7 +44,7 @@ public function build() {
     unset($form['pass']['#description']);
     $form['name']['#size'] = 15;
     $form['pass']['#size'] = 15;
-    $form['#action'] = $this->url('<current>', [], ['query' => drupal_get_destination(), 'external' => FALSE]);
+    $form['#action'] = $this->url(('destination=' . \Drupal::request()->attributes->get('_system_path') == drupal_get_destination() ? NULL : \Drupal::request()->attributes->get('_system_path')), array('query' => drupal_get_destination(), 'external' => FALSE));
     // Build action links.
     $items = array();
     if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
