fix nullreferenceexception when not using email verification

This commit is contained in:
Elijah R 2024-04-08 21:49:16 -04:00
parent ef0a28145b
commit 44afbc8619

View file

@ -1041,7 +1041,7 @@ public static class Routes
} }
else else
{ {
await Program.Database.RegisterAccount(payload.username, payload.email, dob, payload.password, true, null); await Program.Database.RegisterAccount(payload.username, payload.email, dob, payload.password, true, ip, null);
var token = Utilities.RandomString(32); var token = Utilities.RandomString(32);
await Program.Database.CreateSession(user.Username, token, ip); await Program.Database.CreateSession(user.Username, token, ip);
return Results.Json(new RegisterResponse return Results.Json(new RegisterResponse