diff options
author | Vitaly Takmazov | 2016-05-24 14:43:49 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-05-24 14:43:49 +0300 |
commit | 1ce6bc55817129159b1cda5076d039e9c3bc8508 (patch) | |
tree | 6819ab6c4539893749d8a95e7b35e682eca8be56 /src/main/java/com/juick/server/UserQueries.java | |
parent | b633724c75081eb05b70ceee74636f19576a4483 (diff) |
fix telegram signup
Diffstat (limited to 'src/main/java/com/juick/server/UserQueries.java')
-rw-r--r-- | src/main/java/com/juick/server/UserQueries.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/juick/server/UserQueries.java b/src/main/java/com/juick/server/UserQueries.java index 068f0c4b..c9f804cf 100644 --- a/src/main/java/com/juick/server/UserQueries.java +++ b/src/main/java/com/juick/server/UserQueries.java @@ -63,13 +63,13 @@ public class UserQueries { } return hash; } - public static String getSignUpHashByTelegramID(JdbcTemplate sql, Long telegramId) { + public static String getSignUpHashByTelegramID(JdbcTemplate sql, Long telegramId, String username) { try { return sql.queryForObject("SELECT loginhash FROM telegram WHERE tg_id=? AND user_id IS NULL", String.class, telegramId); } catch (EmptyResultDataAccessException e) { String hash = UUID.randomUUID().toString(); - sql.update("INSERT INTO telegram(tg_id, loginhash) VALUES (?, ?)", telegramId, hash); + sql.update("INSERT INTO telegram(tg_id, loginhash, tg_name) VALUES (?, ?, ?)", telegramId, hash, username); return hash; } } |