Skip to content

Instantly share code, notes, and snippets.

View battlecow's full-sized avatar

Brian Kelley battlecow

  • Jamf
  • Eau Claire
View GitHub Profile
angular.module('security.service', ['resources.OAuth', 'resources.user', 'resources.calendars']).factory('Security', ['$q', 'OAuth', 'User', 'localStorageService', 'Calendar', function($q, OAuth, User, localStorageService, Calendar) {
var restoreSession = function() {
var currentUser = localStorageService.get('user');
if (currentUser) {
Calendar.init(currentUser);
var user = User.setCurrentUser(currentUser);
return user;
} else {
return null;
}