added sessionCookie to devlepement env

This commit is contained in:
David Baldwynn 2016-04-10 17:54:41 -04:00
parent b7e00a276e
commit c32fef4338
2 changed files with 14 additions and 8 deletions

View file

@ -21,6 +21,9 @@ module.exports = {
app: {
title: 'TellForm'
},
sessionCookie: {
domain: process.env.BASE_URL || 'http://localhost:3000'
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',

View file

@ -39,7 +39,8 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
if(toState.name === 'home' || toState.name === 'signin' || toState.name === 'resendVerifyEmail' || toState.name === 'verify' || toState.name === 'signup' || toState.name === 'signup-success'){
if(Auth.isAuthenticated()){
event.preventDefault(); // stop current execution
$state.go('listForms'); // go to listForms page
console.log('go to forms');
$state.go('listForms'); // go to listForms page
}
}
//Redirect to 'home' route if user is not authenticated
@ -66,12 +67,14 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
if(user){
authenticator = new Authorizer(user);
console.log('access denied: '+!authenticator.canAccess(permissions));
if( (permissions !== null) && !authenticator.canAccess(permissions) ){
event.preventDefault();
console.log('access denied');
$state.go('access_denied');
//console.log('access denied: '+!authenticator.canAccess(permissions));
//console.log(permissions);
if( (permissions != null) ){
if( !authenticator.canAccess(permissions) ){
event.preventDefault();
console.log('access denied');
$state.go('access_denied');
}
}
}
});
@ -84,4 +87,4 @@ angular.element(document).ready(function() {
//Then init the app
angular.bootstrap(document, [ApplicationConfiguration.applicationModuleName]);
});
});