From 1f2ffaa9e61f2c1ee6bf0a246dc5cf338ef9f794 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Sat, 1 Feb 2014 09:15:33 +0700 Subject: Facebook verified only --- src/java/com/juick/http/www/FacebookLogin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/java/com') diff --git a/src/java/com/juick/http/www/FacebookLogin.java b/src/java/com/juick/http/www/FacebookLogin.java index 7f233f04..9658c0d6 100644 --- a/src/java/com/juick/http/www/FacebookLogin.java +++ b/src/java/com/juick/http/www/FacebookLogin.java @@ -90,6 +90,7 @@ public class FacebookLogin { String fbIDStr = json.getString("id"); String fbName = json.getString("name"); String fbLink = json.getString("link"); + boolean fbVerified = json.getBoolean("verified"); long fbID = 0; if (fbIDStr != null && !fbIDStr.isEmpty()) { @@ -110,13 +111,15 @@ public class FacebookLogin { response.addCookie(c); response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); response.setHeader("Location", "/"); - } else { + } else if (fbVerified) { String loginhash = UUID.randomUUID().toString(); if (!insertDB(sql, fbID, loginhash, token, fbName, fbLink)) { throw new Exception(); } response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); response.setHeader("Location", "/signup?type=fb&hash=" + loginhash); + } else { + throw new Exception(); } } catch (Exception e) { response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); -- cgit v1.2.3