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.java12
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 0bd5fe66..e1c59e65 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;
}
}