From c9d67837cbcaae84a03b7bd14e508ca62880f87f Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 7 Mar 2020 13:20:45 +0300 Subject: Reorganize project layout --- .../java/com/juick/server/www/controllers/SocialLogin.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/juick/server/www/controllers/SocialLogin.java') diff --git a/src/main/java/com/juick/server/www/controllers/SocialLogin.java b/src/main/java/com/juick/server/www/controllers/SocialLogin.java index 710bae8e..e3b7a33b 100644 --- a/src/main/java/com/juick/server/www/controllers/SocialLogin.java +++ b/src/main/java/com/juick/server/www/controllers/SocialLogin.java @@ -22,8 +22,8 @@ import com.github.scribejava.core.builder.ServiceBuilder; import com.github.scribejava.core.model.*; import com.github.scribejava.core.oauth.OAuth10aService; import com.github.scribejava.core.oauth.OAuth20Service; -import com.juick.model.facebook.User; -import com.juick.model.vk.UsersResponse; +import com.juick.model.ext.facebook.User; +import com.juick.model.ext.vk.UsersResponse; import com.juick.server.Utils; import com.juick.server.util.HttpBadRequestException; import com.juick.service.CrosspostService; @@ -193,7 +193,7 @@ public class SocialLogin { } @GetMapping("/_twitter") protected void doTwitterLogin( - @Visitor com.juick.User user, + @Visitor com.juick.model.User user, HttpServletRequest request, HttpServletResponse response) throws IOException, ExecutionException, InterruptedException { String hash = StringUtils.EMPTY, request_token = StringUtils.EMPTY, request_token_secret = StringUtils.EMPTY; @@ -229,8 +229,8 @@ public class SocialLogin { OAuth1AccessToken accessToken = oAuthService.getAccessToken(requestToken, verifier); OAuthRequest oAuthRequest = new OAuthRequest(Verb.GET, TWITTER_VERIFY_URL); oAuthService.signRequest(accessToken, oAuthRequest); - com.juick.model.twitter.User twitterUser = jsonMapper.readValue(oAuthService.execute(oAuthRequest).getBody(), - com.juick.model.twitter.User.class); + com.juick.model.ext.twitter.User twitterUser = jsonMapper.readValue(oAuthService.execute(oAuthRequest).getBody(), + com.juick.model.ext.twitter.User.class); if (userService.linkTwitterAccount(user, accessToken.getToken(), accessToken.getTokenSecret(), twitterUser.getScreenName())) { response.setStatus(HttpServletResponse.SC_FOUND); @@ -267,7 +267,7 @@ public class SocialLogin { vkAuthService.signRequest(token, meRequest); String graph = vkAuthService.execute(meRequest).getBody(); - com.juick.model.vk.User jsonUser = jsonMapper.readValue(graph, UsersResponse.class).getUsers().get(0); + com.juick.model.ext.vk.User jsonUser = jsonMapper.readValue(graph, UsersResponse.class).getUsers().get(0); String vkName = jsonUser.getFirstName() + " " + jsonUser.getLastName(); String vkLink = jsonUser.getScreenName(); @@ -348,7 +348,7 @@ public class SocialLogin { AppleSignInApi api = (AppleSignInApi) appleSignInService.getApi(); var email = api.validateToken(idToken); if (email.isPresent()) { - com.juick.User user = userService.getUserByEmail(email.get()); + com.juick.model.User user = userService.getUserByEmail(email.get()); if (!user.isAnonymous()) { Cookie c = new Cookie("hash", userService.getHashByUID(user.getUid())); c.setMaxAge(50 * 24 * 60 * 60); -- cgit v1.2.3