Ionic with firebase login issue

I’m writing a Login function using Firebase back-end and as it stands it allows all users to login without causing an error and then I need it to route to the home page after. Registration maps to the home page correctly so I’m not sure why login isn’t working.

//login.js

.controller(‘loginController’, function ($scope, $state,$cordovaOauth, $localStorage, $location,$http,$ionicPopup, $firebaseObject, Auth, FURL, Utils) {
var ref = new Firebase(FURL);
var userkey = “”;
$scope.signIn = function (user) {
var profile = ({

    email: user.email,
	password: user.password
  });

$state.go(‘home’);
}
});

//Auth.js

.factory(‘Auth’, function(FURL, $firebaseAuth, $state, $firebaseArray, $firebaseObject, Utils) {

var ref = new Firebase(FURL);
var auth = $firebaseAuth(ref);

var Auth = {
	user: {},

createProfile: function(uid, user) {
  var profile = {
			id: uid,
    email: user.email,
  registered_in: Date()
  };
  $state.go('home');

  var profileRef = $firebaseArray(ref.child('profile'));
  return profileRef.$add(profile).then(function(ref) {
		  var id = ref.key();
		  //console.log("added record with id " + id);
		  profileRef.$indexFor(id); // returns location in the array
		});
},

login: function(user) {
  return auth.$authWithPassword(
    {
		email: user.email, 
	password: user.password
	
	});
},

register: function(user) {
  return auth.$createUser({email: user.email, password: user.password})
    .then(function() {
      // authenticate so we have permission to write to Firebase
      return Auth.login(user);
    })
    .then(function(data) {
      // store user data in Firebase after creating account
				//console.log("datos del usuario:" + JSON.stringify(data));
      return Auth.createProfile(data.uid, user);
    });
},

logout: function() {
  auth.$unauth();
		console.log("Usuario Sale.");
},

	resetpassword: function(user) {
		return auth.$resetPassword({
			  email: user.email
			}).then(function() {
				Utils.alertshow("Exito.","La clave fue enviada a su correo.");
			  //console.log("Password reset email sent successfully!");
			}).catch(function(error) {
				Utils.errMessage(error);
			  //console.error("Error: ", error.message);
			});
},

	changePassword: function(user) {
		return auth.$changePassword({email: user.email, oldPassword: user.oldPass, newPassword: user.newPass});
	},

signedIn: function() {
	
  return !!Auth.user.provider;
  //using !! means (0, undefined, null, etc) = false | otherwise = true

}

};
auth.$onAuth(function(authData) {
	if(authData) {
  angular.copy(authData, Auth.user);
  Auth.user.profile = $firebaseObject(ref.child('profile').child(authData.uid));

	} else {
  if(Auth.user && Auth.user.profile) {
    Auth.user.profile.$destroy();

  }

  angular.copy({}, Auth.user);
	}
});



return Auth;

});

Have you tried $timeout with $state.go?

Yes I got it working, thanks