aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/controllers
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-01-13 23:59:01 +0300
committerGravatar Vitaly Takmazov2017-01-14 00:08:11 +0300
commit053b61f24f52a6e48a5bf51fdbe7eae64c42d001 (patch)
treeadcb0bcd1f89bea20b5d1377847ba6c3707dc984 /juick-www/src/main/java/com/juick/www/controllers
parent33af2da48a51f7e6e5c98016e308c61094cf2e0e (diff)
update dependencies
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/controllers')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/TwitterAuth.java8
1 files changed, 5 insertions, 3 deletions
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);