diff --git a/src/app/accounts/accountsLoginController.js b/src/app/accounts/accountsLoginController.js index 480f9a4239..81f93879f7 100644 --- a/src/app/accounts/accountsLoginController.js +++ b/src/app/accounts/accountsLoginController.js @@ -4,7 +4,18 @@ angular .controller('accountsLoginController', function ($scope, $rootScope, $cookies, apiService, cryptoService, authService, $state, constants, $analytics) { $scope.state = $state; - var returnState = $state.params.returnState; + + var returnState; + if (!$state.params.returnState && $state.params.org) { + returnState = { + name: 'backend.user.settingsCreateOrg', + params: { plan: $state.params.org } + }; + } + else { + returnState = $state.params.returnState; + } + var rememberedEmail = $cookies.get(constants.rememberedEmailCookieName); if (rememberedEmail || $state.params.email) { $scope.model = { diff --git a/src/app/accounts/accountsRegisterController.js b/src/app/accounts/accountsRegisterController.js index 6dc06b7d4f..d45399bc6b 100644 --- a/src/app/accounts/accountsRegisterController.js +++ b/src/app/accounts/accountsRegisterController.js @@ -6,7 +6,16 @@ angular var params = $location.search(); var stateParams = $state.params; - $scope.returnState = $state.params.returnState; + if (!stateParams.returnState && stateParams.org) { + $scope.returnState = { + name: 'backend.user.settingsCreateOrg', + params: { plan: $state.params.org } + }; + } + else { + $scope.returnState = stateParams.returnState; + } + $scope.success = false; $scope.model = { email: params.email ? params.email : stateParams.email diff --git a/src/app/config.js b/src/app/config.js index e1cb1a175d..c696535da9 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -185,7 +185,7 @@ angular } }) .state('frontend.login.info', { - url: '^/', + url: '^/?org', templateUrl: 'app/accounts/views/accountsLoginInfo.html', data: { pageTitle: 'Log In' @@ -225,7 +225,7 @@ angular } }) .state('frontend.register', { - url: '^/register', + url: '^/register?org', templateUrl: 'app/accounts/views/accountsRegister.html', controller: 'accountsRegisterController', params: {