Loading js/pelcro_event.js +3 −3 Original line number Diff line number Diff line Loading @@ -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) }); Loading @@ -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) }); Loading @@ -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) }); Loading src/Controller/UserController.php +2 −2 Original line number Diff line number Diff line Loading @@ -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>'); Loading Loading @@ -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>'); Loading Loading
js/pelcro_event.js +3 −3 Original line number Diff line number Diff line Loading @@ -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) }); Loading @@ -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) }); Loading @@ -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) }); Loading
src/Controller/UserController.php +2 −2 Original line number Diff line number Diff line Loading @@ -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>'); Loading Loading @@ -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>'); Loading