fix: null id when first created
All checks were successful
Build, Package and Push Images / preprocess (push) Successful in 2s
Build, Package and Push Images / build (push) Successful in 27s
Build, Package and Push Images / sbom-scan (push) Successful in 38s
Build, Package and Push Images / container-build (push) Successful in 1m35s
Build, Package and Push Images / sonarqube (push) Successful in 1m39s
Build, Package and Push Images / container-sbom-scan (push) Successful in 36s

This commit is contained in:
Timothy Schenk 2023-11-22 10:24:23 +01:00
parent bd25ff9f09
commit 9bd75cd6c4

View file

@ -33,15 +33,14 @@ public class LoginHandler : IPacketHandler<LoginInfoPacket>
{
LoginResponseReason loginResponseReason;
_logger.LoginData(packet.Username, packet.Password);
var account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username)
;
var account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username);
if (account == null)
{
if (_configuration.GetSection("Testing").GetValue<bool>("CreateAccountOnLogin"))
{
loginResponseReason = await CreateAccountOnLoginAsync(packet.Username, packet.Password)
;
loginResponseReason = await CreateAccountOnLoginAsync(packet.Username, packet.Password);
account = await _wonderkingContext.Accounts.FirstOrDefaultAsync(a => a.Username == packet.Username);
}
else
{