Skip to content

Commit

Permalink
Update user-status endpoint to return a string (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gravewalker666 authored Mar 16, 2020
1 parent 1e81c25 commit 7bc7930
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/lk/sack/livescore/api/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ public void updateScore(HttpSession session, @RequestBody TestMatch match) throw
}

@PostMapping("/user-status")
public void checkUserStatus(HttpSession session) throws UnauthorizedUserException {
public String checkUserStatus(HttpSession session) throws UnauthorizedUserException {
if (session.getAttribute("isAuthorizedUser") == null || session.getAttribute("isAuthorizedUser").equals(false)) {
String message = "Unauthorized attempt to update the score";
String message = "Unauthorized user";
logger.warn(message);
throw new UnauthorizedUserException(message);
}else{
return "Logged in";
}
}
}

0 comments on commit 7bc7930

Please sign in to comment.