diff options
author | 2018-05-04 00:37:35 +0300 | |
---|---|---|
committer | 2018-05-04 00:37:35 +0300 | |
commit | bc2a475df38b0fbe04c6f563d80bf529cd941ca6 (patch) | |
tree | 3b6e7977de48afa16fc0289742acdff0cdb03e99 /juick-www/src/main/java/com/juick/www/controllers | |
parent | 651fe36c3544aa14f13e71c71832d630f3539fb9 (diff) |
add more logging to facebook login
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/controllers')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/SocialLogin.java | 3 |
1 files changed, 3 insertions, 0 deletions
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(); } } |