rsanchez
2014-10-16 4d18a46ee3ada751517f9bf767d5057a3bf5eb9e
securis/src/main/resources/static/js/main.js
....@@ -78,10 +78,14 @@
7878 // configure html5 to get links working on jsfiddle
7979 $locationProvider.html5Mode(true);
8080 $httpProvider.interceptors.push('securisHttpInterceptor');
81
- });
81
+ });
82
+
8283 m.controller('MainCtrl', ['$scope', '$http', '$location', '$L', '$store',
8384 function($scope, $http, $location, $L, $store) {
8485
86
+ $scope.currentRoute = null;
87
+ console.log('Current location: ' + $location);
88
+ console.log($location);
8589 $location.path('/login');
8690 if ($store.get('token') != null) {
8791
....@@ -91,8 +95,10 @@
9195 }
9296 }).success(function(data) {
9397 if (data.valid) {
94
- $http.defaults.headers.common['X-SECURIS-TOKEN'] = $store.get('token');
95
- $location.path('/licenses');
98
+ $http.defaults.headers.common['X-SECURIS-TOKEN'] = $store.get('token');
99
+ var location = $store.get('location') || '/licenses';
100
+
101
+ $location.path(location);
96102 $store.set('user', data.user);
97103 }
98104 });