Updated for TentClient API change
This commit is contained in:
parent
be13a2205c
commit
32c23f64d2
3 changed files with 4 additions and 7 deletions
|
@ -6,7 +6,6 @@ import com.moandjiezana.tent.client.users.Profile;
|
||||||
import com.moandjiezana.tent.essayist.tent.Entities;
|
import com.moandjiezana.tent.essayist.tent.Entities;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
@ -37,7 +36,7 @@ public class EssayServlet extends HttpServlet {
|
||||||
|
|
||||||
TentClient authorTentClient;
|
TentClient authorTentClient;
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
authorTentClient = new TentClient(user.getProfile(), Collections.<String>emptyList());
|
authorTentClient = new TentClient(user.getProfile());
|
||||||
} else {
|
} else {
|
||||||
authorTentClient = new TentClient(authorEntity);
|
authorTentClient = new TentClient(authorEntity);
|
||||||
authorTentClient.discover();
|
authorTentClient.discover();
|
||||||
|
|
|
@ -8,7 +8,6 @@ import com.moandjiezana.tent.client.posts.Post;
|
||||||
import com.moandjiezana.tent.essayist.auth.AuthResult;
|
import com.moandjiezana.tent.essayist.auth.AuthResult;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -52,7 +51,7 @@ public class LoginServlet extends HttpServlet {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
templates.login().render(resp.getWriter());
|
templates.login().render(resp.getWriter());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,7 +68,7 @@ public class LoginServlet extends HttpServlet {
|
||||||
String redirectUri;
|
String redirectUri;
|
||||||
|
|
||||||
if (user != null && user.getRegistration() != null) {
|
if (user != null && user.getRegistration() != null) {
|
||||||
tentClient = new TentClient(user.getProfile(), Collections.<String>emptyList());
|
tentClient = new TentClient(user.getProfile());
|
||||||
tentClient.getAsync().setAccessToken(user.getAccessToken());
|
tentClient.getAsync().setAccessToken(user.getAccessToken());
|
||||||
tentClient.getAsync().setRegistrationResponse(user.getRegistration());
|
tentClient.getAsync().setRegistrationResponse(user.getRegistration());
|
||||||
redirectUri = user.getRegistration().getRedirectUris()[1];
|
redirectUri = user.getRegistration().getRedirectUris()[1];
|
||||||
|
|
|
@ -7,7 +7,6 @@ import com.moandjiezana.tent.client.users.Permissions;
|
||||||
import com.moandjiezana.tent.essayist.tent.Entities;
|
import com.moandjiezana.tent.essayist.tent.Entities;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
@ -58,7 +57,7 @@ public class NewEssayServlet extends HttpServlet {
|
||||||
private TentClient tentClient(HttpServletRequest req) {
|
private TentClient tentClient(HttpServletRequest req) {
|
||||||
User user = (User) req.getSession().getAttribute(User.class.getName());
|
User user = (User) req.getSession().getAttribute(User.class.getName());
|
||||||
|
|
||||||
TentClient tentClient = new TentClient(user.getProfile(), Collections.<String>emptyList());
|
TentClient tentClient = new TentClient(user.getProfile());
|
||||||
tentClient.getAsync().setAccessToken(user.getAccessToken());
|
tentClient.getAsync().setAccessToken(user.getAccessToken());
|
||||||
|
|
||||||
return tentClient;
|
return tentClient;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue