aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/VKontakteLogin.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-04-10 05:00:41 +0700
committerGravatar Ugnich Anton2013-04-10 05:00:41 +0700
commit29150ebc65d0d4cf90da3f437999395a86609504 (patch)
treede7afe09f3ad589a17c099ad3314e58c7a5b438e /src/java/com/juick/http/www/VKontakteLogin.java
parent43299e7174718045d3804f0c3a3fd69a6fc16230 (diff)
VKontakte login
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;
}