Unify ban handling on login

This commit is contained in:
P0nk
2024-09-29 17:54:20 +02:00
parent 50524a7740
commit a307afae3c
7 changed files with 35 additions and 97 deletions

View File

@@ -20,7 +20,7 @@ public class AccountRepository {
public Optional<Account> findByNameIgnoreCase(String name) {
String sql = """
SELECT id, name, password, pin, pic, birthdate, gender, tos_accepted, chr_slots, login_state,
last_login, banned, ban_reason, ban_description, temp_banned_until
last_login, banned, banned_until, ban_reason, ban_description
FROM account
WHERE lower(name) = lower(:name)""";
try (Handle handle = connection.getHandle()) {
@@ -34,7 +34,7 @@ public class AccountRepository {
public Optional<Account> findById(int accountId) {
String sql = """
SELECT id, name, password, pin, pic, birthdate, gender, tos_accepted, chr_slots, login_state,
last_login, banned, ban_reason, ban_description, temp_banned_until
last_login, banned, banned_until, ban_reason, ban_description
FROM account
WHERE id = :id""";
try (Handle handle = connection.getHandle()) {