From a8ea3fe2794ddddc7e30dc002f34006c20592673 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sun, 22 May 2022 11:17:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D1=8F=D0=B5=D1=82=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Authorization.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Authorization.cs b/Authorization.cs index 25b3ded..81f550d 100644 --- a/Authorization.cs +++ b/Authorization.cs @@ -13,7 +13,7 @@ namespace AwesomeEmailExtractor { SqliteCommand command = new SqliteCommand(); command.Connection = Globals.db; - command.CommandText = "SELECT * FROM users WHERE login = @login AND password = @password"; + command.CommandText = "SELECT id, login, role_id FROM users WHERE login = @login AND password = @password"; SqliteParameter loginParam = new SqliteParameter("@login", login); command.Parameters.Add(loginParam); @@ -25,7 +25,7 @@ namespace AwesomeEmailExtractor while (reader.Read()) { - return new User(reader.GetInt32(0), reader.GetString(1), (UserRoles)reader.GetInt32(1)); + return new User(reader.GetInt32(0), reader.GetString(1), (UserRoles)reader.GetInt32(2)); } throw new Exception("Пользователь не найден!");