Commit 1d9a9066 authored by Michael Lutz's avatar Michael Lutz
Browse files

Issue #3296005 by mikelutz: Change 'destination' query parameter used for post login redirects

parent 55eae503
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
    cookie.set(AUTH_COOKIE, btoa(e.detail.data.token), { expires: 14 })
    cookie.set(USER_COOKIE, e.detail.data.id)
    let destination = window.location.href
    let url = window.location.protocol + '//' + window.location.hostname + '/pelcro/login/' + btoa(e.detail.data.token) + '?destination=' + destination
    let url = window.location.protocol + '//' + window.location.hostname + '/pelcro/login/' + btoa(e.detail.data.token) + '?origin=' + destination
    window.location.replace(url)
  });

@@ -36,7 +36,7 @@
    cookie.set(AUTH_COOKIE, btoa(e.detail.data.token), { expires: 14 })
    cookie.set(USER_COOKIE, e.detail.data.id)
    const destination = (drupalSettings.pelcro.subscribeRedirect !== "") ? drupalSettings.pelcro.subscribeRedirect : window.location.href
    const url = window.location.protocol + '//' + window.location.hostname + '/pelcro/refresh/' + btoa(e.detail.data.token) + '?destination=' + destination
    const url = window.location.protocol + '//' + window.location.hostname + '/pelcro/refresh/' + btoa(e.detail.data.token) + '?origin=' + destination
    window.location.replace(url)
  });

@@ -63,7 +63,7 @@
  document.addEventListener("PelcroSyncUser", function (e) {
    cookie.set(AUTH_COOKIE, btoa(Pelcro.user.auth.token), { expires: 14 })
    const destination = (drupalSettings.pelcro.subscribeRedirect !== "") ? drupalSettings.pelcro.subscribeRedirect : window.location.href
    const url = window.location.protocol + '//' + window.location.hostname + '/pelcro/refresh/' + btoa(Pelcro.user.auth.token) + '?destination=' + destination
    const url = window.location.protocol + '//' + window.location.hostname + '/pelcro/refresh/' + btoa(Pelcro.user.auth.token) + '?origin=' + destination
    window.location.replace(url)
  });

+2 −2
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ class UserController extends ControllerBase {
        $this->logger->error("Pelcro Auth call failed. Message was %error", ['%error' => $e->getMessage()]);
      }
    }
    if ($destination = $request->query->get('destination')) {
    if ($destination = $request->query->get('origin')) {
      return new RedirectResponse($destination);
    }
    return $this->redirect('<front>');
@@ -262,7 +262,7 @@ class UserController extends ControllerBase {
    catch (ClientException $e) {
      $this->logger->error("Pelcro Auth call failed. Message was %error", ['%error' => $e->getMessage()]);
    }
    if ($destination = $request->query->get('destination')) {
    if ($destination = $request->query->get('origin')) {
      return new RedirectResponse($destination);
    }
    return $this->redirect('<front>');