diff options
author | Vitaly Takmazov | 2018-06-22 10:07:13 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-06-22 10:33:24 +0300 |
commit | c9834a79f4eb7fc4739bb6d588cbfdf591ae9d82 (patch) | |
tree | 71e5453c7bd8041b540f761fde6dd3c4bd0c7d2a /juick-server/src/main/java/com/juick/service | |
parent | 4b75aae5fdfe1612cf1fae7a526ac4afd60a16c5 (diff) |
VK login
Diffstat (limited to 'juick-server/src/main/java/com/juick/service')
-rw-r--r-- | juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java | 15 |
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 e1c59e657..14bdc7e2c 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) { |