1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-09 09:51:02 +01:00

return state for org create on register/login

This commit is contained in:
Kyle Spearrin 2017-04-25 10:46:54 -04:00
parent c69169cbf9
commit 5c471e43dd
3 changed files with 24 additions and 4 deletions

View File

@ -4,7 +4,18 @@ angular
.controller('accountsLoginController', function ($scope, $rootScope, $cookies, apiService, cryptoService, authService, .controller('accountsLoginController', function ($scope, $rootScope, $cookies, apiService, cryptoService, authService,
$state, constants, $analytics) { $state, constants, $analytics) {
$scope.state = $state; $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); var rememberedEmail = $cookies.get(constants.rememberedEmailCookieName);
if (rememberedEmail || $state.params.email) { if (rememberedEmail || $state.params.email) {
$scope.model = { $scope.model = {

View File

@ -6,7 +6,16 @@ angular
var params = $location.search(); var params = $location.search();
var stateParams = $state.params; 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.success = false;
$scope.model = { $scope.model = {
email: params.email ? params.email : stateParams.email email: params.email ? params.email : stateParams.email

View File

@ -185,7 +185,7 @@ angular
} }
}) })
.state('frontend.login.info', { .state('frontend.login.info', {
url: '^/', url: '^/?org',
templateUrl: 'app/accounts/views/accountsLoginInfo.html', templateUrl: 'app/accounts/views/accountsLoginInfo.html',
data: { data: {
pageTitle: 'Log In' pageTitle: 'Log In'
@ -225,7 +225,7 @@ angular
} }
}) })
.state('frontend.register', { .state('frontend.register', {
url: '^/register', url: '^/register?org',
templateUrl: 'app/accounts/views/accountsRegister.html', templateUrl: 'app/accounts/views/accountsRegister.html',
controller: 'accountsRegisterController', controller: 'accountsRegisterController',
params: { params: {