Unverified Commit 6aaa8c10 authored by Shishir Suman's avatar Shishir Suman Committed by GitHub
Browse files

adding logout method

No related merge requests found
Showing with 13 additions and 0 deletions
+13 -0
......@@ -196,4 +196,17 @@ public class UserHandler {
public ResponseEntity<String> getUserByAttribute(JsonNode body) throws SQLException, IOException, URISyntaxException {
return userService.getUserListByAttribute(body);
}
public ResponseEntity<String> logout(JsonNode jsonNode) throws IOException {
if(jsonNode == null
|| jsonNode.isNull()
|| jsonNode.isEmpty()) {
return ResponseEntity.badRequest().body("Invalid Request");
}
String userId = jsonNode.get("userId").asText();
if(userId == null || userId.isBlank()) {
return ResponseEntity.badRequest().body("Invalid User ID");
}
return userService.logout(userId);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment