diff options
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/VKontakteLogin.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/VKontakteLogin.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java index 6b1d4571..92b22805 100644 --- a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java +++ b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.juick.server.UserQueries; import com.juick.www.vk.Token; import com.juick.www.vk.UsersResponse; +import org.apache.commons.lang3.CharEncoding; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.EmptyResultDataAccessException; @@ -57,12 +58,12 @@ public class VKontakteLogin { String code = request.getParameter("code"); if (code == null || code.equals("")) { response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); - response.setHeader("Location", "https://oauth.vk.com/authorize?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, "utf-8") + "&scope=friends,wall,offline&response_type=code"); + response.setHeader("Location", "https://oauth.vk.com/authorize?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, CharEncoding.UTF_8) + "&scope=friends,wall,offline&response_type=code"); return; } - String tokenjson = Utils.fetchURL("https://oauth.vk.com/access_token?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, "utf-8") + "&client_secret=" + VK_SECRET + "&code=" + URLEncoder.encode(code, "utf-8")); + String tokenjson = Utils.fetchURL("https://oauth.vk.com/access_token?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, CharEncoding.UTF_8) + "&client_secret=" + VK_SECRET + "&code=" + URLEncoder.encode(code, CharEncoding.UTF_8)); if (tokenjson == null || tokenjson.isEmpty()) { logger.error("VK TOKEN EMPTY"); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); |