Skip to content
Snippets Groups Projects
Commit 6e85dd6e authored by Daniel Lorych's avatar Daniel Lorych :cookie:
Browse files

Fix Login query and SQL connection

parent 562d3614
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,8 @@ namespace Helios.Source ...@@ -27,6 +27,8 @@ namespace Helios.Source
private Login GetUserDetails(Login userLogin) private Login GetUserDetails(Login userLogin)
{ {
_connection.Open();
NpgsqlCommand cmd = new NpgsqlCommand("select * from user_login where email = @emailParam and user_password = @passwordParam", _connection); NpgsqlCommand cmd = new NpgsqlCommand("select * from user_login where email = @emailParam and user_password = @passwordParam", _connection);
cmd.Parameters.AddWithValue("@emailParam", userLogin.EmailAddress); cmd.Parameters.AddWithValue("@emailParam", userLogin.EmailAddress);
...@@ -45,6 +47,8 @@ namespace Helios.Source ...@@ -45,6 +47,8 @@ namespace Helios.Source
userLogin.IsAdmin = false; userLogin.IsAdmin = false;
} }
_connection.Close();
return userLogin; return userLogin;
} }
} }
......
{ {
"ConnectionStrings": { "ConnectionStrings": {
"Default": "User ID=myusername;Password=mypassword;Host=localhost;Port=5432;Database=helios;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;" "Default": "User ID=myusername;Password=mypassword;Host=localhost;Port=5432;Database=helios;"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment