Dont hardcode user as "jvyden"

This commit is contained in:
jvyden 2021-10-14 01:26:00 -04:00
commit 59ba45036d
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
7 changed files with 37 additions and 14 deletions

View file

@ -31,9 +31,9 @@ namespace ProjectLighthouse.Controllers {
[HttpPost("updateUser")]
public async Task<IActionResult> UpdateUser() {
await using Database database = new();
User user = await database.Users.Where(u => u.Username == "jvyden").FirstOrDefaultAsync();
User user = await database.UserFromRequest(Request);
if(user == null) return this.BadRequest();
if(user == null) return this.StatusCode(403, "");
XmlReaderSettings settings = new() {
Async = true // this is apparently not default