aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/UserQueries.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server/UserQueries.java')
-rw-r--r--src/main/java/com/juick/server/UserQueries.java4
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;
}
}