From: netoguimaraes Date: Wed, 26 Dec 2018 20:16:36 +0000 (-0300) Subject: FS-11584: [verto_communicator] make user able to login using url params X-Git-Tag: v1.8.5~1^2~23^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85cfd5b5ab1b4f183b23a5de627b5e3588f373f7;p=thirdparty%2Ffreeswitch.git FS-11584: [verto_communicator] make user able to login using url params --- diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js index d6f1d0366f..d9caa5c1f0 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoginController.js @@ -11,7 +11,18 @@ } } preRoute(); - + + var name = $location.search().name; + var email = $location.search().email; + var skipPreview = $location.search().skipPreview; + + if (name && email) { + verto.data.name = name; + verto.data.email = email; + $scope.login(true, skipPreview); + return; + } + verto.data.name = $scope.storage.data.name; verto.data.email = $scope.storage.data.email; diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js index 066b69b33e..5534a6b817 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js @@ -77,7 +77,7 @@ * Login the user to verto server and * redirects him to dialpad page. */ - $scope.login = function(redirect) { + $rootScope.login = function(redirect, skipPreview = false) { if(redirect == undefined) { redirect = true; } @@ -97,7 +97,7 @@ verto.testSpeed(); } - if (redirect && storage.data.preview) { + if (redirect && storage.data.preview && !skipPreview) { $location.path('/loading'); } else if (redirect) { $location.path('/dialpad');