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: { app: {
title: 'TellForm' title: 'TellForm'
}, },
sessionCookie: {
domain: process.env.BASE_URL || 'http://localhost:3000'
},
facebook: { facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID', clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET', clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',

View file

@ -39,6 +39,7 @@ 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(toState.name === 'home' || toState.name === 'signin' || toState.name === 'resendVerifyEmail' || toState.name === 'verify' || toState.name === 'signup' || toState.name === 'signup-success'){
if(Auth.isAuthenticated()){ if(Auth.isAuthenticated()){
event.preventDefault(); // stop current execution event.preventDefault(); // stop current execution
console.log('go to forms');
$state.go('listForms'); // go to listForms page $state.go('listForms'); // go to listForms page
} }
} }
@ -66,14 +67,16 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
if(user){ if(user){
authenticator = new Authorizer(user); authenticator = new Authorizer(user);
console.log('access denied: '+!authenticator.canAccess(permissions)); //console.log('access denied: '+!authenticator.canAccess(permissions));
//console.log(permissions);
if( (permissions !== null) && !authenticator.canAccess(permissions) ){ if( (permissions != null) ){
if( !authenticator.canAccess(permissions) ){
event.preventDefault(); event.preventDefault();
console.log('access denied'); console.log('access denied');
$state.go('access_denied'); $state.go('access_denied');
} }
} }
}
}); });
}]); }]);