From c9834a79f4eb7fc4739bb6d588cbfdf591ae9d82 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 22 Jun 2018 10:07:13 +0300 Subject: VK login --- .../main/java/com/juick/service/CrosspostServiceImpl.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'juick-server/src/main/java/com/juick/service') 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 @@ -59,6 +59,11 @@ public class CrosspostServiceImpl extends BaseJdbcService implements CrosspostSe jdbcTemplate.update("INSERT INTO facebook(loginhash, fb_link) VALUES(?, ?)", state, redirectUri); } + @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 { @@ -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> getFacebookTokens(final int uid) { -- cgit v1.2.3