diff --git a/Moonlight/App/Services/Sessions/IdentityService.cs b/Moonlight/App/Services/Sessions/IdentityService.cs index f9a5d76..b3be75c 100644 --- a/Moonlight/App/Services/Sessions/IdentityService.cs +++ b/Moonlight/App/Services/Sessions/IdentityService.cs @@ -112,7 +112,7 @@ public class IdentityService if (user == null) { Logger.Warn( - $"Cannot find user with the id '{userid}' in the database. Maybe the user has been deleted or a token has been successfully faked by a hacker"); + $"Cannot find user with the id '{userid}' in the database. Maybe the user has been deleted or a token has been successfully faked by a hacker", "security"); return; } diff --git a/Moonlight/App/Services/UserService.cs b/Moonlight/App/Services/UserService.cs index 6045d49..96e5f76 100644 --- a/Moonlight/App/Services/UserService.cs +++ b/Moonlight/App/Services/UserService.cs @@ -66,17 +66,15 @@ public class UserService { throw new DisplayException("The email is already in use"); } - - //TODO: Validation // Add user var user = UserRepository.Add(new() { Address = "", - Admin = false, + Admin = !UserRepository.Get().Any(), City = "", Country = "", - Email = email, + Email = email.ToLower(), Password = BCrypt.Net.BCrypt.HashPassword(password), FirstName = firstname, LastName = lastname, diff --git a/Moonlight/Properties/launchSettings.json b/Moonlight/Properties/launchSettings.json index 75db4aa..9d66209 100644 --- a/Moonlight/Properties/launchSettings.json +++ b/Moonlight/Properties/launchSettings.json @@ -35,6 +35,18 @@ }, "applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118", "dotnetRunMessages": true + }, + "Dev DB 2": + { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ML_DEBUG": "true", + "ML_CONFIG_PATH": "storage\\configs\\dev_2_config.json" + }, + "applicationUrl": "http://moonlight.testy:5118;https://localhost:7118;http://localhost:5118", + "dotnetRunMessages": true } } } \ No newline at end of file