(function() {
  var SettingsCtrl = function($scope, $ionicModal, Auth) {
    var vm = this

    $ionicModal

      .fromTemplateUrl("js/modules/tabs/settings/views/login.html", {

        scope: $scope,
        animation: "slide-in-up"

      })
      .then(function(modal) {

          vm.loginModal = modal;

      })

    vm.openModal  = openModal
    vm.closeModal = closeModal
    vm.login      = login

    //////////////////////

    function openModal() {
        vm.loginModal.show();
    };
    function closeModal(){
      vm.loginModal.hide();
    }
    function login(){
      Auth.setAuthToken( vm.username, vm.password );
    }

  };
  SettingsCtrl
    .$inject = ['$scope', '$ionicModal', 'Auth'];
  angular
    .module('app.modules.tabs.settings.controllers', [])
    .controller('SettingsCtrl', SettingsCtrl);
})();

@@ -581,60 +581,249 @@
 ()%7B%0A
-      Auth.setAuthToken( vm.username, vm.password );
+%0A      Restangular.all('users').all('login').post( vm.username, vm.password )%0A        .then(function(err, result)%7B%0A          if (err) throw%0A            Auth.setAuthToken( result.user.username, result.sessionsToken, result.user );%0A        %7D)%0A
 %0A   

Fix bug issue in Settings Ctrl