Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tanordheim
Created September 12, 2014 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanordheim/0f925a0e13b0f060ad6c to your computer and use it in GitHub Desktop.
Save tanordheim/0f925a0e13b0f060ad6c to your computer and use it in GitHub Desktop.
angular.module("app").controller("AppCtrl", function($scope, $http, $window, configuration, currentUserFactory, authService) {
$scope.config = configuration;
$scope.$on("event:auth-loginRequired", function() {
$http.post("/auth/refresh").then(function(response) {
authService.loginConfirmed();
}, function(response) {
$window.location.href = "/auth/logged_out";
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment