updated errors to actually show and error codes to be correct 401 rather than 403
This commit is contained in:
parent
261cb1ebb1
commit
18db5f47e8
@ -165,10 +165,11 @@ daddy.controller("createTopicCtrlr", function($scope, $location, $http, stateDat
|
||||
$scope.createPost($scope.topic.postContent, res.data.topicNo)
|
||||
}
|
||||
}).catch((res) => {
|
||||
$scope.status.show = true;
|
||||
if (res.status == 500) {
|
||||
console.log("something went wrong: " + res.data)
|
||||
$scope.status.text = "Something went wrong: " + res.status
|
||||
} else if (res.status == 403) {
|
||||
} else if (res.status == 401) {
|
||||
console.log("something went worng: " + res.data)
|
||||
$scope.status.text = "Authentication failed. For saftey reasons, you have been logged out, please log in and try again."
|
||||
stateData.logOut()
|
||||
@ -196,10 +197,11 @@ daddy.controller("createTopicCtrlr", function($scope, $location, $http, stateDat
|
||||
$location.path("/topics/" + topicNo)
|
||||
}
|
||||
}).catch((res) => {
|
||||
$scope.status.show = true;
|
||||
if (res.status == 500) {
|
||||
console.log("something went wrong: " + res.data)
|
||||
$scope.status.text = "Something went wrong: " + res.status
|
||||
} else if (res.status == 403) {
|
||||
} else if (res.status == 401) {
|
||||
console.log("something went worng: " + res.data)
|
||||
$scope.status.text = "Authentication failed. For saftey reasons, you have been logged out, please log in and try again."
|
||||
stateData.logOut()
|
||||
@ -271,10 +273,11 @@ daddy.controller("createCategoryCtrlr", function($scope, $http, $location, state
|
||||
$location.path("/categories/" + res.data.catNo)
|
||||
}
|
||||
}).catch((res) => {
|
||||
$scope.status.show = true;
|
||||
if (res.status == 500) {
|
||||
console.log("something went wrong: " + res.data)
|
||||
$scope.status.text = "Something went wrong: " + res.status
|
||||
} else if (res.status == 403) {
|
||||
} else if (res.status == 401) {
|
||||
console.log("something went worng: " + res.data)
|
||||
$scope.status.text = "Authentication failed. For saftey reasons, you have been logged out, please log in and try again."
|
||||
stateData.logOut()
|
||||
@ -360,11 +363,12 @@ daddy.controller("topicsCtrlr", function($scope, $routeParams, $timeout, $http,
|
||||
$timeout(function() { $scope.getTopic() }, 2000)
|
||||
}
|
||||
}).catch((res) => {
|
||||
$scope.status.show = true;
|
||||
if (res.status == 500) {
|
||||
console.log("something went wrong: ")
|
||||
console.log(res.data)
|
||||
$scope.status.text = "Something went wrong: " + res.status
|
||||
} else if (res.status == 403) {
|
||||
} else if (res.status == 401) {
|
||||
console.log("something went worng: " + res.data)
|
||||
$scope.status.text = "Authentication failed. For saftey reasons, you have been logged out, please log in and try again."
|
||||
stateData.logOut()
|
||||
@ -405,10 +409,11 @@ daddy.controller("topicsCtrlr", function($scope, $routeParams, $timeout, $http,
|
||||
}
|
||||
}).catch((res) => {
|
||||
if (res.status == 500) {
|
||||
$scope.status.show = true;
|
||||
console.log("something went wrong: ")
|
||||
console.log(res.data)
|
||||
$scope.status.text = "Something went wrong: " + res.status
|
||||
} else if (res.status == 403) {
|
||||
} else if (res.status == 401) {
|
||||
console.log("something went worng: " + res.data)
|
||||
$scope.status.text = "Authentication failed. For saftey reasons, you have been logged out, please log in and try again."
|
||||
stateData.logOut()
|
||||
@ -440,11 +445,12 @@ daddy.controller("topicsCtrlr", function($scope, $routeParams, $timeout, $http,
|
||||
}
|
||||
}
|
||||
}).catch((res) => {
|
||||
$scope.status.show = true;
|
||||
if (res.status == 500) {
|
||||
console.log("something went wrong: ")
|
||||
console.log(res.data)
|
||||
$scope.status.text = "Something went wrong: " + res.status
|
||||
} else if (res.status == 403) {
|
||||
} else if (res.status == 401) {
|
||||
console.log("something went worng: " + res.data)
|
||||
$scope.status.text = "Authentication failed. For saftey reasons, you have been logged out, please log in and try again."
|
||||
stateData.logOut()
|
||||
|
||||
@ -30,7 +30,9 @@
|
||||
<tr>
|
||||
<td colspan="2" ng-show="state.user.userNo == null">{{logged.text1}} <span class="link"
|
||||
ng-click="setLogin()">{{logged.link1}}</span> {{logged.text2}} <span class="link"
|
||||
ng-click="setSignup()">{{logged.link2}}</span> {{logged.text3}}</td>
|
||||
ng-click="setSignup()">{{logged.link2}}</span> {{logged.text3}}
|
||||
<p class="status" ng-show="status.show">{{status.text}}</p>
|
||||
</td>
|
||||
<td colspan="2" ng-show="state.user.userNo != null">
|
||||
<form name="replyForm" id="replyForm" ng-submit="makeReply(topic.topicNo)">
|
||||
<label for="replyCotnent">Reply:</label> <br />
|
||||
|
||||
Reference in New Issue
Block a user