diff --git a/app/templates/client/components/auth(auth)/auth.service(js).js b/app/templates/client/components/auth(auth)/auth.service(js).js index 9afb12da9..eb2cb1c10 100644 --- a/app/templates/client/components/auth(auth)/auth.service(js).js +++ b/app/templates/client/components/auth(auth)/auth.service(js).js @@ -1,9 +1,9 @@ 'use strict'; angular.module('<%= scriptAppName %>') - .factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) { + .factory('Auth', function Auth($location, $rootScope, $http, User, $cookies, $q) { var currentUser = {}; - if($cookieStore.get('token')) { + if($cookies.get('token')) { currentUser = User.get(); } @@ -25,7 +25,7 @@ angular.module('<%= scriptAppName %>') password: user.password }). success(function(data) { - $cookieStore.put('token', data.token); + $cookies.put('token', data.token); currentUser = User.get(); deferred.resolve(data); return cb(); @@ -45,7 +45,7 @@ angular.module('<%= scriptAppName %>') * @param {Function} */ logout: function() { - $cookieStore.remove('token'); + $cookies.remove('token'); currentUser = {}; }, @@ -61,7 +61,7 @@ angular.module('<%= scriptAppName %>') return User.save(user, function(data) { - $cookieStore.put('token', data.token); + $cookies.put('token', data.token); currentUser = User.get(); return cb(user); }, @@ -140,7 +140,7 @@ angular.module('<%= scriptAppName %>') * Get auth token */ getToken: function() { - return $cookieStore.get('token'); + return $cookies.get('token'); } }; });