diff options
author | Ugnich Anton | 2014-02-01 09:15:33 +0700 |
---|---|---|
committer | Ugnich Anton | 2014-02-01 09:15:33 +0700 |
commit | 1f2ffaa9e61f2c1ee6bf0a246dc5cf338ef9f794 (patch) | |
tree | 96cf97a37e117d05c29a54df1badd533c0e437a7 /src | |
parent | ab78d170650106d1d1113282598b6d8270ef2e76 (diff) |
Facebook verified only
Diffstat (limited to 'src')
-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); |