aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java')
-rw-r--r--juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java b/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java
index e1c59e65..14bdc7e2 100644
--- a/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java
@@ -60,6 +60,11 @@ public class CrosspostServiceImpl extends BaseJdbcService implements CrosspostSe
}
@Override
+ public void addVKState(String state, String redirectUri) {
+ jdbcTemplate.update("INSERT INTO vk(loginhash, vk_link) VALUES(?, ?)", state, redirectUri);
+ }
+
+ @Override
public String verifyFacebookState(String state) {
try {
return jdbcTemplate.queryForObject("SELECT fb_link FROM facebook WHERE loginhash=?",
@@ -69,6 +74,16 @@ public class CrosspostServiceImpl extends BaseJdbcService implements CrosspostSe
}
}
+ @Override
+ public String verifyVKState(String state) {
+ try {
+ return jdbcTemplate.queryForObject("SELECT vk_link FROM vk WHERE loginhash=?",
+ String.class, state);
+ } catch (EmptyResultDataAccessException e) {
+ return StringUtils.EMPTY;
+ }
+ }
+
@Transactional(readOnly = true)
@Override
public Optional<Pair<String, String>> getFacebookTokens(final int uid) {