@cryptotaxi247 / netdata-1 / commits / c5973d15d

6542: after clicking Nodes and successfully logging in, user should be redirected to console (#6544)

Jacek Kolasa committed Jul 25, 2019 at 16:58 UTC c5973d15d137ce0e8f0f9d6719d866ce6737e448
1 file changed +5 -2
web/gui/main.js
+5 -2
@@ -704,11 +704,11 @@ function restrictMyNetdataMenu() {
704 </div>`);
705 }
706
707 -function openAuthenticatedUrl(url) {
707 +function openAuthenticatedUrl(url) {
708 if (isSignedIn()) {
709 window.open(url);
710 } else {
711 - window.open(`${NETDATA.registry.cloudBaseURL}/account/sign-in-agent?id=${NETDATA.registry.machine_guid}&name=${encodeURIComponent(NETDATA.registry.hostname)}&origin=${encodeURIComponent(window.location.origin + "/")}`);
711 + window.open(`${NETDATA.registry.cloudBaseURL}/account/sign-in-agent?id=${NETDATA.registry.machine_guid}&name=${encodeURIComponent(NETDATA.registry.hostname)}&origin=${encodeURIComponent(window.location.origin + "/")}&redirectUrl=${encodeURIComponent(window.location.origin + "/" + url)}`);
712 }
713 }
714
@@ -4897,6 +4897,9 @@ function handleSignInMessage(e) {
4897 cloudToken = e.data.token;
4898
4899 netdataRegistryCallback(registryAgents);
4900 + if (e.data.redirectUrl) {
4901 + window.location.replace(e.data.redirectUrl);
4902 + }
4903 }
4904
4905 function handleSignOutMessage(e) {