diff options
Diffstat (limited to 'src/java/com/juick')
-rw-r--r-- | src/java/com/juick/http/www/FacebookLogin.java | 5 |
1 files changed, 4 insertions, 1 deletions
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); |