21 lines
No EOL
598 B
JavaScript
21 lines
No EOL
598 B
JavaScript
angular.module('SeHub')
|
|
.controller('mainController', ['$scope', '$rootScope', 'apiService', '$cookies', '$location', function ($scope, $rootScope, apiService, $cookies, $location) {
|
|
|
|
$rootScope.seToken = $cookies['com.sehub.www'];
|
|
var token = $rootScope.seToken;
|
|
$scope.loadingData = true;
|
|
|
|
apiService.getUserByToken(token).success(function(data){
|
|
console.log(data);
|
|
if(data.message == 'No User Found')
|
|
console.error("No User Found!");
|
|
|
|
$scope.user = data;
|
|
$rootScope.user = data;
|
|
if($scope.user.isFirstLogin)
|
|
$location.path('/register')
|
|
})
|
|
|
|
$scope.loadingData = false;
|
|
|
|
}]); |