From 00b26d6e89229197f493796b93dabe1ec802e28d Mon Sep 17 00:00:00 2001 From: kingcody Date: Tue, 28 Jul 2015 17:22:17 -0400 Subject: [PATCH] rollback #1092 --- .../client/components/auth(auth)/auth.service(js).js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 eb2cb1c10..9afb12da9 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, $cookies, $q) { + .factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) { var currentUser = {}; - if($cookies.get('token')) { + if($cookieStore.get('token')) { currentUser = User.get(); } @@ -25,7 +25,7 @@ angular.module('<%= scriptAppName %>') password: user.password }). success(function(data) { - $cookies.put('token', data.token); + $cookieStore.put('token', data.token); currentUser = User.get(); deferred.resolve(data); return cb(); @@ -45,7 +45,7 @@ angular.module('<%= scriptAppName %>') * @param {Function} */ logout: function() { - $cookies.remove('token'); + $cookieStore.remove('token'); currentUser = {}; }, @@ -61,7 +61,7 @@ angular.module('<%= scriptAppName %>') return User.save(user, function(data) { - $cookies.put('token', data.token); + $cookieStore.put('token', data.token); currentUser = User.get(); return cb(user); }, @@ -140,7 +140,7 @@ angular.module('<%= scriptAppName %>') * Get auth token */ getToken: function() { - return $cookies.get('token'); + return $cookieStore.get('token'); } }; });