added sessionCookie to devlepement env
This commit is contained in:
parent
b7e00a276e
commit
c32fef4338
3
config/env/development.js
vendored
3
config/env/development.js
vendored
|
@ -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',
|
||||
|
|
|
@ -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]);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue