<commit_before>(function(){
  'use strict';

  ucone.factory('Auth', ['$base64', '$rootScope', '$http', 'Storage', '$q', function($base64, $rootScope, $http, Storage, $q){
    var service = {};

    service.clearCredentials = function () {
      $http.defaults.headers.common.Authorization = 'Basic ';
      $rootScope.username = '';
      $rootScope.authdata = '';
    };

    service.setCredentials = function (username, password, xsp) {
      service.clearCredentials();

      var authdata = $base64.encode(username + ':' + password);

      $rootScope.xsp = xsp;
      $rootScope.username = username;
      $rootScope.authdata = authdata;

      console.log(username);
      console.log($rootScope.username);

      $http.defaults.headers.common['Authorization'] = 'Basic ' + authdata;
    };

    service.setConfig = function(){
      var defer = $q.defer();
      var configuration;

      chrome.storage.local.get(function(storage){
        configuration = {
          'ws_servers' : [ {
            'ws_uri' : 'wss://wrs3.ihs.broadsoft.com:8060',
            'weight' : 0
          } ],
          'uri' : storage.sipConfig.sipLineport,
          'auth_user': storage.sipConfig.sipUsername,
          'authorization_user': storage.sipConfig.sipUsername,
          'password': storage.sipConfig.sipPassword,
          'stun_servers': '192.168.127.12:3478',
          'trace_sip' : true,
          'displayName': (_.unescape(storage.sipConfig.userFirstName + ' ' + storage.sipConfig.userLastName)).replace("&apos;", "'")
        };

        $rootScope.userFirstName = storage.sipConfig.userFirstName;

        defer.resolve(configuration);<commit_msg>adding in support for the configs<commit_after>(function(){
  'use strict';

  ucone.factory('Auth', ['$base64', '$rootScope', '$http', 'Storage', '$q', function($base64, $rootScope, $http, Storage, $q){
    var service = {};

    service.clearCredentials = function () {
      $http.defaults.headers.common.Authorization = 'Basic ';
      $rootScope.username = '';
      $rootScope.authdata = '';
    };

    service.setCredentials = function (username, password, xsp) {
      service.clearCredentials();

      var authdata = $base64.encode(username + ':' + password);

      $rootScope.xsp = xsp;
      $rootScope.username = username;
      $rootScope.authdata = authdata;

      console.log(username);
      console.log($rootScope.username);

      $http.defaults.headers.common['Authorization'] = 'Basic ' + authdata;
    };

    service.setConfig = function(){
      var defer = $q.defer();
      var configuration;

      chrome.storage.local.get(function(storage){
        configuration = {
          'ws_servers' : [ {
            'ws_uri' : storage.sipConfig.primaryWrsAddress,
            'weight' : 0
          } ],
          'uri' : storage.sipConfig.sipLineport,
          'auth_user': storage.sipConfig.sipUsername,
          'authorization_user': storage.sipConfig.sipUsername,
          'password': storage.sipConfig.sipPassword,
          'stun_servers': storage.sipConfig.primaryStunServer,
          'trace_sip' : true,
          'displayName': (_.unescape(storage.sipConfig.userFirstName + ' ' + storage.sipConfig.userLastName)).replace("&apos;", "'")
        };

        $rootScope.userFirstName = storage.sipConfig.userFirstName;

        defer.resolve(configuration);
{'fraction_non_alphanumeric': 0.15143369175627241, 'fraction_numerical': 0.01015531660692951, 'mean_word_length': 2.805681818181818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4534128', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1011, 'n_words': 154}