From 85cfd5b5ab1b4f183b23a5de627b5e3588f373f7 Mon Sep 17 00:00:00 2001 From: netoguimaraes Date: Wed, 26 Dec 2018 17:16:36 -0300 Subject: [PATCH] FS-11584: [verto_communicator] make user able to login using url params --- .../vertoControllers/controllers/LoginController.js | 13 ++++++++++++- .../vertoControllers/controllers/MainController.js | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) 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');