From 56fb104e148153b68019b3c3b451161117549ec3 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 18 Dec 2022 13:16:58 +0100 Subject: [PATCH] Update logic in UserManagerDB, as the default user id is -1 now. --- modules/users/managers/user_manager_db.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/users/managers/user_manager_db.cpp b/modules/users/managers/user_manager_db.cpp index 9e1465c92..11b21745d 100644 --- a/modules/users/managers/user_manager_db.cpp +++ b/modules/users/managers/user_manager_db.cpp @@ -139,7 +139,7 @@ Ref UserManagerDB::_get_user_name(const String &user_name) { void UserManagerDB::_save_user(Ref user) { Ref b = get_query_builder(); - if (user->get_user_id() == 0) { + if (user->get_user_id() == -1) { b->insert(_database_table_name, "username, email, rank, pre_salt, post_salt, password_hash, banned, password_reset_token, locked"); b->values(); @@ -156,7 +156,7 @@ void UserManagerDB::_save_user(Ref user) { b->end_command(); b->select_last_insert_id(); - + Ref r = b->run(); user->set_user_id(r->get_last_insert_rowid());