From 35c72527e2e5ab8ad666d27e7b89dcfdfbf38beb Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Mon, 16 Apr 2018 15:44:05 -0400 Subject: [PATCH] Fix password hashings not being reapplied --- src/Tgstation.Server.Host/Controllers/HomeController.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Controllers/HomeController.cs b/src/Tgstation.Server.Host/Controllers/HomeController.cs index 02947c7272..b7f01326dc 100644 --- a/src/Tgstation.Server.Host/Controllers/HomeController.cs +++ b/src/Tgstation.Server.Host/Controllers/HomeController.cs @@ -83,7 +83,13 @@ namespace Tgstation.Server.Host.Controllers return Unauthorized(); if (user.PasswordHash != originalHash) { - DatabaseContext.Users.Attach(user); + var updatedUser = new User + { + Id = user.Id, + PasswordHash = originalHash + }; + DatabaseContext.Users.Attach(updatedUser); + updatedUser.PasswordHash = user.PasswordHash; await DatabaseContext.Save(cancellationToken).ConfigureAwait(false); } }