Peticiones XHR con token

This commit is contained in:
Juan Ferrer Toribio 2017-05-18 17:35:07 +02:00
parent 2c7a37c4b6
commit a2ac778c9a
48 changed files with 167 additions and 156 deletions

View File

@ -10,3 +10,4 @@ rules:
radix: 0 radix: 0
guard-for-in: 0 guard-for-in: 0
camelcase: 0 camelcase: 0
default-case: 0

View File

@ -5,6 +5,6 @@
"main": "index.js", "main": "index.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://git.verdnatura.es:/salix" "url": "https://git.verdnatura.es/salix"
} }
} }

View File

@ -3,7 +3,7 @@
<div class="box"> <div class="box">
<img src="./logo.svg"/> <img src="./logo.svg"/>
<form name="form" ng-submit="$ctrl.submit()"> <form name="form" ng-submit="$ctrl.submit()">
<vn-textfield label="User" model="$ctrl.email"></vn-textfield> <vn-textfield vn-id="userField" label="User" model="$ctrl.email"></vn-textfield>
<vn-textfield label="Password" model="$ctrl.password" type="password"></vn-textfield> <vn-textfield label="Password" model="$ctrl.password" type="password"></vn-textfield>
<div class="footer"> <div class="footer">
<vn-submit label="Enter"></vn-submit> <vn-submit label="Enter"></vn-submit>

View File

@ -10,6 +10,7 @@ export default class Controller {
} }
submit() { submit() {
if (!(this.email && this.password)) { if (!(this.email && this.password)) {
this.focusUser();
this.showMessage('Please insert your email and password'); this.showMessage('Please insert your email and password');
return; return;
} }
@ -46,7 +47,8 @@ export default class Controller {
} }
onLoginErr(json) { onLoginErr(json) {
this.loading = false; this.loading = false;
this.model.password = ''; this.password = '';
this.focusUser();
let message; let message;
@ -63,8 +65,12 @@ export default class Controller {
this.showMessage(message); this.showMessage(message);
} }
focusUser() {
this.$.userField.select();
this.$.userField.focus();
}
showMessage(message) { showMessage(message) {
this.$.snackbar.show({message: message}); this.snackbar.show({message: message});
} }
} }
Controller.$inject = ['$element', '$scope', '$window', '$http']; Controller.$inject = ['$element', '$scope', '$window', '$http'];

View File

@ -5,6 +5,6 @@
"main": "index.js", "main": "index.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://git.verdnatura.es:/salix" "url": "https://git.verdnatura.es/salix"
} }
} }

View File

@ -2,25 +2,25 @@
vn-id="watcher" vn-id="watcher"
url="/client/api/Addresses" url="/client/api/Addresses"
id-field="id" id-field="id"
data="addressData.address" data="$ctrl.address"
form="form"> form="form">
</vn-watcher> </vn-watcher>
<form name="form" ng-submit="addressData.onSubmit()" pad-medium> <form name="form" ng-submit="$ctrl.onSubmit()" pad-medium>
<vn-card > <vn-card >
<vn-vertical pad-large> <vn-vertical pad-large>
<vn-title>Consignatario</vn-title> <vn-title>Consignatario</vn-title>
<vn-horizontal> <vn-horizontal>
<vn-check vn-one label="Predeterminado" field="addressData.address.default"></vn-check> <vn-check vn-one label="Predeterminado" field="$ctrl.address.default"></vn-check>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Consignatario" field="addressData.address.consignee" vn-focus></vn-textfield> <vn-textfield vn-one label="Consignatario" field="$ctrl.address.consignee" vn-focus></vn-textfield>
<vn-textfield vn-one label="Domicilio" field="addressData.address.street"></vn-textfield> <vn-textfield vn-one label="Domicilio" field="$ctrl.address.street"></vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield vn-one label="Código Postal" field="addressData.address.postcode"></vn-textfield> <vn-textfield vn-one label="Código Postal" field="$ctrl.address.postcode"></vn-textfield>
<vn-textfield vn-one label="Municipio" field="addressData.address.city"></vn-textfield> <vn-textfield vn-one label="Municipio" field="$ctrl.address.city"></vn-textfield>
<vn-autocomplete vn-one <vn-autocomplete vn-one
field="addressData.address.provinceFk" field="$ctrl.address.provinceFk"
url="/client/api/Provinces" url="/client/api/Provinces"
show-field="name" show-field="name"
value-field="id" value-field="id"
@ -29,14 +29,14 @@
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-autocomplete vn-one <vn-autocomplete vn-one
field="addressData.address.agencyFk" field="$ctrl.address.agencyFk"
url="/client/api/AgencyServices" url="/client/api/AgencyServices"
show-field="name" show-field="name"
value-field="id" value-field="id"
label="Agencia"> label="Agencia">
</vn-autocomplete> </vn-autocomplete>
<vn-textfield vn-one label="Teléfono" field="addressData.address.phone"></vn-textfield> <vn-textfield vn-one label="Teléfono" field="$ctrl.address.phone"></vn-textfield>
<vn-textfield vn-one label="Móvil" field="addressData.address.mobile"></vn-textfield> <vn-textfield vn-one label="Móvil" field="$ctrl.address.mobile"></vn-textfield>
</vn-horizontal> </vn-horizontal>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>

View File

@ -2,7 +2,7 @@ import {module} from '../module';
class Controller { class Controller {
constructor($scope, $state) { constructor($scope, $state) {
this.$scope = $scope; this.$ = $scope;
this.$state = $state; this.$state = $state;
this.address = { this.address = {
client: parseInt($state.params.id), client: parseInt($state.params.id),
@ -10,7 +10,7 @@ class Controller {
}; };
} }
onSubmit() { onSubmit() {
this.$scope.watcher.submit().then( this.$.watcher.submit().then(
() => this.$state.go('clientCard.addresses') () => this.$state.go('clientCard.addresses')
); );
} }
@ -20,7 +20,6 @@ Controller.$inject = ['$scope', '$state'];
export const NAME = 'vnAddressCreate'; export const NAME = 'vnAddressCreate';
export const COMPONENT = { export const COMPONENT = {
template: require('./index.html'), template: require('./index.html'),
controllerAs: 'addressData',
controller: Controller controller: Controller
}; };
module.component(NAME, COMPONENT); module.component(NAME, COMPONENT);

View File

@ -5,6 +5,6 @@
"main": "index.js", "main": "index.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://git.verdnatura.es:/salix" "url": "https://git.verdnatura.es/salix"
} }
} }

View File

@ -34,14 +34,3 @@ export function getProviderName(name) {
export function getTemplateName(componentName, frameworkName) { export function getTemplateName(componentName, frameworkName) {
return componentName + '.' + frameworkName + '.html'; return componentName + '.' + frameworkName + '.html';
} }
export function getVendorDependencies(vendors) {
let dependencies = [];
Object.keys(vendors).forEach(vendor => {
let name = vendors[vendor].name;
if (name) {
dependencies.push(name);
}
});
return dependencies;
}

View File

@ -1,7 +1,12 @@
/**
* Rewrited CSS rules from Material Design Lite.
* TODO: don't use !important
*/
.mdl-textfield { .mdl-textfield {
width: 100%; width: 100%;
} }
/* TODO: No utilizar !important */
.mdl-button { .mdl-button {
font-weight: bolder; font-weight: bolder;
color: #ffa410; color: #ffa410;

View File

@ -1,5 +1,10 @@
import * as vendors from 'vendor'; import * as vendors from 'vendor';
import {getVendorDependencies} from './lib/util';
const DEPENDENCIES = getVendorDependencies(vendors); let deps = [];
export const module = vendors.ng.module('vnCore', DEPENDENCIES); Object.keys(vendors).forEach(vendor => {
let name = vendors[vendor].name;
if (name)
deps.push(name);
});
export const module = vendors.ng.module('vnCore', deps);

View File

@ -48,6 +48,18 @@ export default class Textfield extends Component {
let clearButton = this.element.querySelector('button'); let clearButton = this.element.querySelector('button');
clearButton.style.visibility = show ? 'visible' : 'hidden'; clearButton.style.visibility = show ? 'visible' : 'hidden';
} }
/**
* Selects the textfield.
*/
select() {
this.input.select();
}
/**
* Puts the focus on the textfield.
*/
focus() {
this.input.focus();
}
} }
Textfield.$inject = ['$element', '$scope', '$attrs']; Textfield.$inject = ['$element', '$scope', '$attrs'];

View File

@ -1,32 +1,39 @@
import {module} from '../../module'; import ngModule from '../../module';
import './style.scss'; import './style.scss';
export const NAME = 'vnApp'; export const NAME = 'vnApp';
export const COMPONENT = { export const COMPONENT = {
template: require('./app.html') template: require('./app.html')
}; };
module.component(NAME, COMPONENT); ngModule.component(NAME, COMPONENT);
vnAppLogger.$inject = ['$document']; vnAppLogger.$inject = ['$document'];
function vnAppLogger($document) { function vnAppLogger($document) {
return { return {
showMessage: function (message) { showMessage: function(message) {
let snackbar = $document.find('vn-snackbar').controller('vnSnackbar'); let snackbar = $document.find('vn-snackbar').controller('vnSnackbar');
snackbar.show({message: message}); snackbar.show({message: message});
}, },
showError: function(message) { showError: function(message) {
this.showMessage(`Error: ${message}`); this.showMessage(`Error: ${message}`);
} }
} };
} }
module.provider('vnAppLogger', function() {this.$get = vnAppLogger;}); ngModule.provider('vnAppLogger', function() {
this.$get = vnAppLogger;
});
vnAppInterceptor.$inject = ['$q', '$rootScope', 'vnAppLogger', '$translate']; vnAppInterceptor.$inject = ['$q', '$rootScope', 'vnAppLogger', '$translate', '$cookies'];
function vnAppInterceptor($q, $rootScope, logger, $translate) { function vnAppInterceptor($q, $rootScope, logger, $translate, $cookies) {
$rootScope.loading = false; $rootScope.loading = false;
return { return {
request: function(config) { request: function(config) {
$rootScope.loading = true; $rootScope.loading = true;
let token = $cookies.get('vnToken');
if (token)
config.url = config.url += '?access_token=' + encodeURIComponent(token);
return config; return config;
}, },
requestError: function(rejection) { requestError: function(rejection) {
@ -34,9 +41,9 @@ function vnAppInterceptor($q, $rootScope, logger, $translate) {
}, },
response: function(response) { response: function(response) {
switch (response.config.method) { switch (response.config.method) {
case 'PUT': case 'PUT':
case 'POST': case 'POST':
logger.showMessage($translate.instant('Data saved!')); logger.showMessage($translate.instant('Data saved!'));
} }
$rootScope.loading = false; $rootScope.loading = false;
return response; return response;
@ -49,10 +56,10 @@ function vnAppInterceptor($q, $rootScope, logger, $translate) {
} }
}; };
} }
module.factory('vnAppInterceptor', vnAppInterceptor); ngModule.factory('vnAppInterceptor', vnAppInterceptor);
interceptorConfig.$inject = ['$httpProvider']; interceptorConfig.$inject = ['$httpProvider'];
function interceptorConfig($httpProvider) { function interceptorConfig($httpProvider) {
$httpProvider.interceptors.push('vnAppInterceptor'); $httpProvider.interceptors.push('vnAppInterceptor');
} }
module.config(interceptorConfig); ngModule.config(interceptorConfig);

View File

@ -1,5 +1,5 @@
<vn-horizontal> <vn-horizontal>
<ul style="list-style-type: none; margin: 0; padding: 0; width: 100%; color: #666;"> <ul style="list-style-type: none; margin: 0; padding: 0; width: 100%; color: #666;">
<vn-menu-item ng-repeat="item in action.items" item = "item"></vn-menu-item> <vn-menu-item ng-repeat="item in $ctrl.items" item = "item"></vn-menu-item>
</ul> </ul>
</vn-horizontal> </vn-horizontal>

View File

@ -1,12 +1,8 @@
import template from './actions.html'; import ngModule from '../../module';
import {module} from '../../module';
export const NAME = 'vnActions'; ngModule.component('vnActions', {
export const COMPONENT = { template: require('./actions.html'),
template: template,
controllerAs: "action",
bindings: { bindings: {
items: '<' items: '<'
} }
}; });
module.component(NAME, COMPONENT);

View File

@ -1,5 +1,5 @@
<vn-card > <vn-card >
<vn-vertical pad-medium-top pad-medium-bottom> <vn-vertical pad-medium-top pad-medium-bottom>
<vn-actions items="menu.items"></vn-actions> <vn-actions items="$ctrl.items"></vn-actions>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>

View File

@ -1,13 +1,9 @@
import {module} from '../../module'; import ngModule from '../../module';
import template from './left-menu.html';
import './style.css'; import './style.css';
export const NAME = 'vnLeftMenu'; ngModule.component('vnLeftMenu', {
export const COMPONENT = { template: require('./left-menu.html'),
template: template,
controllerAs: "menu",
bindings: { bindings: {
items: '<' items: '<'
} }
}; });
module.component(NAME, COMPONENT);

View File

@ -1,7 +1,7 @@
<li> <li>
<a ui-sref="{{menu.item.href}}" style="display: block; text-decoration: none; color: inherit; padding: .5em 2em;"> <a ui-sref="{{$ctrl.item.href}}" style="display: block; text-decoration: none; color: inherit; padding: .5em 2em;">
<i class="material-icons" style="float: right; margin-left: .4em;">keyboard_arrow_right</i> <i class="material-icons" style="float: right; margin-left: .4em;">keyboard_arrow_right</i>
<i class="material-icons" style="vertical-align: middle; margin-right: .4em;">{{menu.item.icon}}</i> <i class="material-icons" style="vertical-align: middle; margin-right: .4em;">{{$ctrl.item.icon}}</i>
<span>{{menu.item.description}}</span> <span>{{$ctrl.item.description}}</span>
</a> </a>
</li> </li>

View File

@ -1,11 +1,8 @@
import {module} from '../../module'; import ngModule from '../../module';
export const NAME = 'vnMenuItem'; ngModule.component('vnMenuItem', {
export const COMPONENT = {
template: require('./menu-item.html'), template: require('./menu-item.html'),
controllerAs: 'menu',
bindings: { bindings: {
item: '<' item: '<'
} }
}; });
module.component(NAME, COMPONENT);

View File

@ -1,8 +1,8 @@
<div style="position: fixed; top: 0; right: 0; padding: .8em 1.5em; z-index: 10;"> <div style="position: fixed; top: 0; right: 0; padding: .8em 1.5em; z-index: 10;">
<vn-icon icon="apps" id="apps" translate-attr="{title: 'Applications'}"></vn-icon> <vn-icon icon="apps" id="apps" translate-attr="{title: 'Applications'}"></vn-icon>
<vn-icon icon="notifications" translate-attr="{title: 'Notifications'}"></vn-icon> <vn-icon icon="notifications" translate-attr="{title: 'Notifications'}"></vn-icon>
<vn-icon icon="language" translate-attr="{title: 'Change language'}" ng-click="mainMenu.onChangeLanguage()"></vn-icon> <vn-icon icon="language" translate-attr="{title: 'Change language'}" ng-click="$ctrl.onChangeLanguage()"></vn-icon>
<vn-icon icon="exit_to_app" translate-attr="{title: 'Logout'}" ng-click="mainMenu.onLogoutClick()"></vn-icon> <vn-icon icon="exit_to_app" translate-attr="{title: 'Logout'}" ng-click="$ctrl.onLogoutClick()"></vn-icon>
<vn-icon icon="account_circle" translate-attr="{title: 'Profile'}" style="font-size: 35px;"></vn-icon> <vn-icon icon="account_circle" translate-attr="{title: 'Profile'}" style="font-size: 35px;"></vn-icon>
<ul class="mdl-menu mdl-js-menu mdl-menu--bottom-right" pad-medium for="apps"> <ul class="mdl-menu mdl-js-menu mdl-menu--bottom-right" pad-medium for="apps">
<vn-horizontal> <vn-horizontal>

View File

@ -1,22 +1,23 @@
import ngModule from '../../module';
import './style.scss'; import './style.scss';
import {module} from '../../module';
export const NAME = 'vnMainMenu'; export default class Controller {
export const COMPONENT = { constructor($translate, $window) {
template: require('./main-menu.html'), this.$translate = $translate;
controllerAs: "mainMenu", this.$window = $window;
controller: controller }
}; onLogoutClick() {
module.component(NAME, COMPONENT); this.$window.location = 'salix/logout';
}
controller.$inject = ['$translate', '$window', '$document']; onChangeLanguage() {
function controller($translate, $window, $document) { let lang = this.$translate.use() == 'en' ? 'es' : 'en';
this.onLogoutClick = function() { this.$translate.use(lang);
$window.location = 'salix/logout';
};
this.onChangeLanguage = function() {
let lang = $translate.use() == 'en' ? 'es' : 'en';
$translate.use(lang);
console.log(`Locale changed: ${lang}`); console.log(`Locale changed: ${lang}`);
}; }
} }
Controller.$inject = ['$translate', '$window'];
ngModule.component('vnMainMenu', {
template: require('./main-menu.html'),
controller: Controller
});

View File

@ -1,7 +1,6 @@
import {module} from '../../module'; import ngModule from '../../module';
require('./style.css');
class Controller { export default class Controller {
constructor($element, $scope, $document, $compile, vnPopover, $window) { constructor($element, $scope, $document, $compile, vnPopover, $window) {
this.element = $element[0]; this.element = $element[0];
this.$scope = $scope; this.$scope = $scope;
@ -36,8 +35,7 @@ class Controller {
} }
Controller.$inject = ['$element', '$scope', '$document', '$compile', 'vnPopover', '$window']; Controller.$inject = ['$element', '$scope', '$document', '$compile', 'vnPopover', '$window'];
export const NAME = 'vnSearchbar'; ngModule.component('vnSearchbar', {
export const COMPONENT = {
template: require('./searchbar.html'), template: require('./searchbar.html'),
bindings: { bindings: {
index: '<', index: '<',
@ -46,5 +44,4 @@ export const COMPONENT = {
popover: '@' popover: '@'
}, },
controller: Controller controller: Controller
}; });
module.component(NAME, COMPONENT);

View File

@ -1,8 +1,6 @@
import {module} from '../../module'; import ngModule from '../../module';
export const NAME = 'vnTopbar'; ngModule.component('vnTopbar', {
export const COMPONENT = {
template: require('./topbar.html'), template: require('./topbar.html'),
transclude: true transclude: true
}; });
module.component(NAME, COMPONENT);

View File

@ -1,13 +1,13 @@
import {module} from './module'; import ngModule from './module';
config.$inject = ['$translatePartialLoaderProvider']; config.$inject = ['$translatePartialLoaderProvider'];
export function config($translatePartialLoaderProvider) { export function config($translatePartialLoaderProvider) {
$translatePartialLoaderProvider.addPart('salix'); $translatePartialLoaderProvider.addPart('salix');
} }
module.config(config); ngModule.config(config);
run.$inject = ['$window', '$rootScope']; run.$inject = ['$window', '$rootScope'];
export function run($window, $rootScope) { export function run($window, $rootScope) {
$window.validations = {}; $window.validations = {};
} }
module.run(run); ngModule.run(run);

View File

@ -1,6 +1,6 @@
import './spliting'; import './spliting';
import deps from 'spliting/modules.json'; import deps from 'spliting/modules.json';
import {module} from './module'; import ngModule from './module';
import {splitingRegister} from 'core'; import {splitingRegister} from 'core';
function loader(moduleName) { function loader(moduleName) {
@ -44,4 +44,4 @@ function config($stateProvider, $urlRouterProvider) {
}); });
} }
} }
module.config(config); ngModule.config(config);

View File

@ -1,4 +1,5 @@
import {ng} from 'vendor'; import {ng} from 'vendor';
import 'core'; import 'core';
export const module = ng.module('salix', ['vnCore']); const ngModule = ng.module('salix', ['vnCore']);
export default ngModule;

View File

@ -1,4 +1,4 @@
import {module} from './module'; import ngModule from './module';
const HOOK_ABORTED_TRANSITION = 3; const HOOK_ABORTED_TRANSITION = 3;
@ -11,4 +11,4 @@ export function run($rootScope, $state) {
window.myAppErrorLog.push(error); window.myAppErrorLog.push(error);
}); });
} }
module.run(run); ngModule.run(run);

View File

@ -5,6 +5,6 @@
"main": "index.js", "main": "index.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://git.verdnatura.es:/salix" "url": "https://git.verdnatura.es/salix"
} }
} }

5
client/vendor/src/angular-cookies.js vendored Normal file
View File

@ -0,0 +1,5 @@
import 'angular-cookies';
export const angularCookies = {
name: 'ngCookies'
};

View File

@ -1,5 +1,5 @@
import 'angular-paging'; import 'angular-paging';
export const ngPaging = { export const angularPaging = {
name: 'bw.paging' name: 'bw.paging'
}; };

View File

@ -1,6 +1,6 @@
import 'angular-translate'; import 'angular-translate';
import 'angular-translate-loader-partial'; import 'angular-translate-loader-partial';
export const ngTranslate = { export const angularTranslate = {
name: 'pascalprecht.translate' name: 'pascalprecht.translate'
}; };

View File

@ -0,0 +1,5 @@
import 'angular-ui-router';
export const angularUiRouter = {
name: 'ui.router'
};

View File

@ -3,6 +3,6 @@ import * as angular from 'angular';
export const ng = { export const ng = {
module: angular.module, module: angular.module,
bootstrap: angular.bootstrap, bootstrap: angular.bootstrap,
$$minErr :angular.$$minErr, $$minErr: angular.$$minErr,
angular: angular angular: angular
} };

View File

@ -1,4 +1,4 @@
import * as mdl from 'material-design-lite'; import * as mdl from 'material-design-lite';
import 'material-design-lite/dist/material.orange-deep_orange.min.css'; import 'material-design-lite/dist/material.orange-deep_orange.min.css';
export const materialdesignlite = mdl; export const materialDesignLite = mdl;

View File

@ -1,7 +1,5 @@
import 'oclazyload'; import 'oclazyload';
import {getComponentName} from './util';
export const oclazyload = { export const ocLazyLoad = {
name: 'oc.lazyLoad', name: 'oc.lazyLoad'
oclazyload: getComponentName('$ocLazyLoad',true) };
}

View File

@ -1,7 +0,0 @@
import 'angular-ui-router';
import {getComponentName} from './util';
export const uirouter = {
name: 'ui.router',
state: getComponentName('$state',true)
}

View File

@ -1,11 +0,0 @@
export function getComponentName(name, isProvider) {
if (isProvider) {
return {
name: name,
provider: name + "Provider"
};
}
return {
name: name
};
}

View File

@ -1,8 +1,9 @@
export * from './angular'; export * from './angular';
export * from './ui-router'; export * from './angular-cookies';
export * from './angular-translate';
export * from './angular-paging';
export * from './angular-ui-router';
export * from './mg-crud'; export * from './mg-crud';
export * from './oc-lazy-load'; export * from './oc-lazy-load';
export * from './angular-translate';
export * from './material-design-lite'; export * from './material-design-lite';
export * from './angular-paging';
export * from './validator'; export * from './validator';

View File

@ -11,13 +11,13 @@ goto caseUsage
:caseStart :caseStart
call "%0" stop call "%0" stop
echo "Starting nginx." echo Starting nginx.
if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp") if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp")
start /I nginx -c "%nginxConf%" -p "%nginxPrefix%" start /I nginx -c "%nginxConf%" -p "%nginxPrefix%"
goto caseEnd goto caseEnd
:caseStop :caseStop
echo "Stoping nginx." echo Stoping nginx.
if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop) if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop)
goto caseEnd goto caseEnd

View File

@ -9,7 +9,8 @@
"url": "http://git.verdnatura.es:/salix" "url": "http://git.verdnatura.es:/salix"
}, },
"dependencies": { "dependencies": {
"angular": "^1.6.1", "angular": "^1.6.4",
"angular-cookies": "^1.6.4",
"angular-paging": "^2.2.2", "angular-paging": "^2.2.2",
"angular-translate": "^2.13.1", "angular-translate": "^2.13.1",
"angular-translate-loader-partial": "^2.13.1", "angular-translate-loader-partial": "^2.13.1",

View File

@ -2,6 +2,7 @@
"restApiRoot": "/api", "restApiRoot": "/api",
"host": "0.0.0.0", "host": "0.0.0.0",
"port": 3000, "port": 3000,
"aclErrorStatus": 403,
"remoting": { "remoting": {
"context": false, "context": false,
"rest": { "rest": {

View File

@ -145,8 +145,14 @@
{ {
"accessType": "*", "accessType": "*",
"principalType": "ROLE", "principalType": "ROLE",
"principalId": "$everyone", "principalId": "$authenticated",
"permission": "ALLOW" "permission": "ALLOW"
},
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
} }
], ],
"methods": {} "methods": {}

View File

@ -2,6 +2,7 @@
"restApiRoot": "/api", "restApiRoot": "/api",
"host": "0.0.0.0", "host": "0.0.0.0",
"port": 3002, "port": 3002,
"aclErrorStatus": 403,
"logoutSessionsOnSensitiveChanges": true, "logoutSessionsOnSensitiveChanges": true,
"remoting": { "remoting": {
"context": false, "context": false,

View File

@ -15,7 +15,7 @@ module.exports = function (app) {
validateToken(token, function(isValid) { validateToken(token, function(isValid) {
if (isValid) { if (isValid) {
res.cookie('vnToken', token, {httpOnly: true}); res.cookie('vnToken', token/*, {httpOnly: true}*/);
res.redirect(continueUrl ? continueUrl : '/salix'); res.redirect(continueUrl ? continueUrl : '/salix');
} }
else else

View File

@ -2,6 +2,7 @@
"restApiRoot": "/api", "restApiRoot": "/api",
"host": "0.0.0.0", "host": "0.0.0.0",
"port": 3001, "port": 3001,
"aclErrorStatus": 403,
"remoting": { "remoting": {
"context": false, "context": false,
"rest": { "rest": {