From bc2a475df38b0fbe04c6f563d80bf529cd941ca6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 4 May 2018 00:37:35 +0300 Subject: add more logging to facebook login --- juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'juick-www') diff --git a/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java b/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java index fd2fd38d..fdc2f6f2 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java +++ b/juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java @@ -148,12 +148,14 @@ public class SocialLogin { User fb = jsonMapper.readValue(graph, User.class); long fbID = NumberUtils.toLong(fb.getId(), 0); if (fbID == 0 || StringUtils.isBlank(fb.getName()) || StringUtils.isBlank(fb.getLink())) { + logger.error("Missing required fields, id: {}, name: {}, link: {}", fbID, fb.getName(), fb.getLink()); throw new HttpBadRequestException(); } int uid = crosspostService.getUIDbyFBID(fbID); if (uid > 0) { if (!crosspostService.updateFacebookUser(fbID, token.getAccessToken(), fb.getName(), fb.getLink())) { + logger.error("error updating facebook user, id: {}, token: {}", fbID, token.getAccessToken()); throw new HttpBadRequestException(); } Cookie c = new Cookie("hash", userService.getHashByUID(uid)); @@ -175,6 +177,7 @@ public class SocialLogin { } return "redirect:/signup?type=fb&hash=" + loginhash; } else { + logger.error("Facebook account is not verified, id: {}", fbID); throw new HttpBadRequestException(); } } -- cgit v1.2.3