diff --git a/app/assets/javascripts/controllers/application.coffee.erb b/app/assets/javascripts/controllers/application.coffee.erb index 043bfbab6..095c50892 100644 --- a/app/assets/javascripts/controllers/application.coffee.erb +++ b/app/assets/javascripts/controllers/application.coffee.erb @@ -23,14 +23,15 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco # @param user {Object} Rails/Devise user ## $scope.setCurrentUser = (user) -> - $rootScope.currentUser = user - Session.create(user); - getNotifications() - # fab-manager's app-version - if user.role == 'admin' - $scope.version = Version.get() - else - $scope.version = {version: ''} + unless angular.isUndefinedOrNull(user) + $rootScope.currentUser = user + Session.create(user); + getNotifications() + # fab-manager's app-version + if user.role == 'admin' + $scope.version = Version.get() + else + $scope.version = {version: ''} ## diff --git a/config/secrets.yml b/config/secrets.yml index 9a835c283..fc6fcaebe 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -17,6 +17,8 @@ development: stripe_currency: <%= ENV["STRIPE_CURRENCY"] %> disqus_shortname: <%= ENV["DISQUS_SHORTNAME"] %> fablab_without_plans: <%= ENV["FABLAB_WITHOUT_PLANS"] %> + default_host: <%= ENV["DEFAULT_HOST"] %> + default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %> time_zone: <%= ENV["TIME_ZONE"] %> week_starting_day: <%= ENV["WEEK_STARTING_DAY"] %> d3_date_format: <%= ENV["D3_DATE_FORMAT"].dump %> # .dump is needed as the value may start by a '%', see https://github.com/tenderlove/psych/issues/75 @@ -45,6 +47,8 @@ test: stripe_currency: usd disqus_shortname: fablab-sleede fablab_without_plans: false + default_host: <%= ENV["DEFAULT_HOST"] %> + default_protocol: <%= ENV["DEFAULT_PROTOCOL"] %> time_zone: Paris week_starting_day: monday d3_date_format: '%d/%m/%y'