aboutsummaryrefslogtreecommitdiff
path: root/juick-www
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www')
-rw-r--r--juick-www/build.gradle4
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/TwitterAuth.java8
2 files changed, 7 insertions, 5 deletions
diff --git a/juick-www/build.gradle b/juick-www/build.gradle
index 26cf61da..ae9815d5 100644
--- a/juick-www/build.gradle
+++ b/juick-www/build.gradle
@@ -6,7 +6,7 @@ buildscript {
}
plugins {
- id "com.moowork.node" version "1.0.0"
+ id "com.moowork.node" version "1.1.0"
}
task compileFrontend(type: NpmTask) {
@@ -20,7 +20,7 @@ apply plugin: 'com.github.ben-manes.versions'
dependencies {
compile project(':juick-server')
- compile 'com.github.scribejava:scribejava-apis:3.4.1'
+ compile 'com.github.scribejava:scribejava-apis:4.0.0'
compile 'net.coobird:thumbnailator:0.4.8'
compile 'com.github.ooxi:serialized-php-parser:0.5.0'
compile 'com.mitchellbosecke:pebble:2.3.0'
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);