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: {
|
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',
|
||||||
|
|
|
@ -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(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
|
||||||
$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
|
//Redirect to 'home' route if user is not authenticated
|
||||||
|
@ -66,12 +67,14 @@ 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) ){
|
||||||
event.preventDefault();
|
if( !authenticator.canAccess(permissions) ){
|
||||||
console.log('access denied');
|
event.preventDefault();
|
||||||
$state.go('access_denied');
|
console.log('access denied');
|
||||||
|
$state.go('access_denied');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -84,4 +87,4 @@ angular.element(document).ready(function() {
|
||||||
|
|
||||||
//Then init the app
|
//Then init the app
|
||||||
angular.bootstrap(document, [ApplicationConfiguration.applicationModuleName]);
|
angular.bootstrap(document, [ApplicationConfiguration.applicationModuleName]);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue