diff options
author | Vitaly Takmazov | 2018-06-21 22:49:13 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-06-21 22:55:53 +0300 |
commit | 4b75aae5fdfe1612cf1fae7a526ac4afd60a16c5 (patch) | |
tree | 76bcbd92df2f743ac62b29918bab68ae25c119e4 /juick-server/src/main/java/com/juick/service | |
parent | 8022992b2601badfe53d6e58aa73268d5e8f1aa4 (diff) |
fix facebook login redirect
Diffstat (limited to 'juick-server/src/main/java/com/juick/service')
-rw-r--r-- | juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java | 12 |
1 files changed, 6 insertions, 6 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 0bd5fe664..e1c59e657 100644 --- a/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/CrosspostServiceImpl.java @@ -55,17 +55,17 @@ public class CrosspostServiceImpl extends BaseJdbcService implements CrosspostSe } @Override - public void addFacebookState(String state) { - jdbcTemplate.update("INSERT INTO facebook(loginhash) VALUES(?)", state); + public void addFacebookState(String state, String redirectUri) { + jdbcTemplate.update("INSERT INTO facebook(loginhash, fb_link) VALUES(?, ?)", state, redirectUri); } @Override - public boolean verifyFacebookState(String state) { + public String verifyFacebookState(String state) { try { - return jdbcTemplate.queryForObject("SELECT COUNT(loginhash) FROM facebook WHERE loginhash=?", - Integer.class, state) == 1; + return jdbcTemplate.queryForObject("SELECT fb_link FROM facebook WHERE loginhash=?", + String.class, state); } catch (EmptyResultDataAccessException e) { - return false; + return StringUtils.EMPTY; } } |