From 7bc79303a928fc0a6ae236090e41e2f22a910992 Mon Sep 17 00:00:00 2001 From: Gravewalker666 <45477334+Gravewalker666@users.noreply.github.com> Date: Mon, 16 Mar 2020 17:15:40 +0530 Subject: [PATCH] Update user-status endpoint to return a string (#24) --- src/main/java/lk/sack/livescore/api/MainController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/lk/sack/livescore/api/MainController.java b/src/main/java/lk/sack/livescore/api/MainController.java index 697739a..7e81c18 100644 --- a/src/main/java/lk/sack/livescore/api/MainController.java +++ b/src/main/java/lk/sack/livescore/api/MainController.java @@ -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"; } } }