Skip to content

Commit

Permalink
rollback #1092
Browse files Browse the repository at this point in the history
  • Loading branch information
kingcody committed Jul 28, 2015
1 parent 18b0f5c commit 00b26d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/templates/client/components/auth(auth)/auth.service(js).js
Original file line number Diff line number Diff line change
@@ -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();
}

Expand All @@ -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();
Expand All @@ -45,7 +45,7 @@ angular.module('<%= scriptAppName %>')
* @param {Function}
*/
logout: function() {
$cookies.remove('token');
$cookieStore.remove('token');
currentUser = {};
},

Expand All @@ -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);
},
Expand Down Expand Up @@ -140,7 +140,7 @@ angular.module('<%= scriptAppName %>')
* Get auth token
*/
getToken: function() {
return $cookies.get('token');
return $cookieStore.get('token');
}
};
});

0 comments on commit 00b26d6

Please sign in to comment.