From 053b61f24f52a6e48a5bf51fdbe7eae64c42d001 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 13 Jan 2017 23:59:01 +0300 Subject: update dependencies --- .../src/main/java/com/juick/www/controllers/TwitterAuth.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'juick-www/src') diff --git a/juick-www/src/main/java/com/juick/www/controllers/TwitterAuth.java b/juick-www/src/main/java/com/juick/www/controllers/TwitterAuth.java index 901a8362..9b09539e 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/TwitterAuth.java +++ b/juick-www/src/main/java/com/juick/www/controllers/TwitterAuth.java @@ -21,6 +21,7 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.concurrent.ExecutionException; /** * Created by vt on 01.12.2015. @@ -49,7 +50,7 @@ public class TwitterAuth { @RequestMapping(value = "/_twitter", method = RequestMethod.GET) protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws IOException { + throws IOException, ExecutionException, InterruptedException { String hash = StringUtils.EMPTY, request_token = StringUtils.EMPTY, request_token_secret = StringUtils.EMPTY; String verifier = request.getParameter("oauth_verifier"); Cookie[] cookies = request.getCookies(); @@ -87,9 +88,10 @@ public class TwitterAuth { if (verifier != null && verifier.length() > 0) { OAuth1RequestToken requestToken = new OAuth1RequestToken(request_token, request_token_secret); OAuth1AccessToken accessToken = oAuthService.getAccessToken(requestToken, verifier); - OAuthRequest oAuthRequest = new OAuthRequest(Verb.GET, VERIFY_URL, oAuthService.getConfig()); + OAuthRequest oAuthRequest = new OAuthRequest(Verb.GET, VERIFY_URL); oAuthService.signRequest(accessToken, oAuthRequest); - com.juick.www.twitter.User twitterUser = mapper.readValue(oAuthRequest.send().getBody(), com.juick.www.twitter.User.class); + com.juick.www.twitter.User twitterUser = mapper.readValue(oAuthService.execute(oAuthRequest).getBody(), + com.juick.www.twitter.User.class); if (userService.linkTwitterAccount(user, accessToken.getToken(), accessToken.getTokenSecret(), twitterUser.getScreenName())) { response.setStatus(HttpServletResponse.SC_FOUND); -- cgit v1.2.3