{"size": 877, "ext": "js", "max_stars_repo_path": "app/scripts/services/User.js", "max_stars_repo_name": "cwaters1993/bloc-chat", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/scripts/services/User.js", "max_issues_repo_name": "cwaters1993/bloc-chat", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/scripts/services/User.js", "max_forks_repo_name": "cwaters1993/bloc-chat", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.0789473684, "max_line_length": 52, "alphanum_fraction": 0.5655644242}
(function() {
  function User($firebaseArray) {
    var User = {};
    var currentUser = null;
    User.username = null;
    User.updateInfo = function(){
      var currentUser = firebase.auth().currentUser;
      User.username = currentUser.displayName;
    };

    User.setUsername = function(username){
      var user = firebase.auth().currentUser;
      user.updateProfile({
        displayName: username,
      }).then(function() {
        // Update successful.
      }).catch(function(error) {
        // An error happened.
      });
    }

    User.signOut = function() {
      firebase.auth().signOut().then(function() {
        // Sign-out successful.
      }).catch(function(error) {
        // An error happened.
        alert(error.message);
      });
    };

    return User;
  }

  angular
    .module('blocChat')
    .factory('User', ['$firebase', User]);
})();
