aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/VKontakteLogin.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/juick/http/www/VKontakteLogin.java')
-rw-r--r--src/java/com/juick/http/www/VKontakteLogin.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/java/com/juick/http/www/VKontakteLogin.java b/src/java/com/juick/http/www/VKontakteLogin.java
index e7252b57..5f26fef1 100644
--- a/src/java/com/juick/http/www/VKontakteLogin.java
+++ b/src/java/com/juick/http/www/VKontakteLogin.java
@@ -38,8 +38,8 @@ import org.json.JSONObject;
*/
public class VKontakteLogin {
- private static final String VK_APPID = "3531222";
- private static final String VK_SECRET = "EhgW6VJrl02oFPO0buiJ";
+ private static final String VK_APPID = "3544101";
+ private static final String VK_SECRET = "z2afNI8jA5lIpZ2jsTm1";
private static final String VK_REDIRECT = "http://juick.com/_vklogin";
protected void doGet(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
@@ -84,7 +84,7 @@ public class VKontakteLogin {
}
try {
- JSONObject json = new JSONObject(graph);
+ JSONObject json = new JSONObject(graph).getJSONArray("response").getJSONObject(0);
String vkName = json.getString("first_name") + " " + json.getString("last_name");
String vkLink = json.getString("screen_name");
@@ -108,6 +108,7 @@ public class VKontakteLogin {
response.setHeader("Location", "/signup?type=vk&hash=" + loginhash);
}
} catch (Exception e) {
+ System.err.println("JSON ERROR: " + e);
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}