Open GinaAntonini opened 6 years ago
In LoginCtrl.js:
app.controller("LoginCtrl", function($location, $rootScope, $scope, AuthService) {
$scope.authenticate = () => {
AuthService.authenticateGoogle().then((result) => {
$rootScope.uid = result.user.uid;
$scope.$apply(() => {
$location.url("/contacts/view");
});
}).catch((err) => {
console.log("error in authenticateGoogle", err);
});
};
});
In AuthService.js: