mhafizhasan
1/26/2018 - 2:27 PM

GateKeeper Service

gatekeeper services

.service('GateKeeper', function($http, constant, $rootScope, $state) {

        this.validate = function() {

            $http.post(constant.apiUrl + '/analytics/gateKeeper', {
                token: $rootScope.token
            }).success(function(response) {

                if(response != 1) {
                    $state.go('logout');
                }

            }).error(function() {
                console.log('errror');
            });

        }

});