Implement checking for the Patchwork user agent, move logout into standalone method

This commit is contained in:
FeTetra 2025-05-25 20:10:26 -04:00
commit 68dbf50253
7 changed files with 72 additions and 8 deletions

View file

@ -214,7 +214,11 @@ public class LoginController : ControllerBase
Logger.Success($"Successfully logged in user {user.Username} as {token.GameVersion} client", LogArea.Login);
user.LastLogin = TimeHelper.TimestampMillis;
string userAgent = this.Request.Headers.UserAgent.ToString();
if (!String.IsNullOrWhiteSpace(userAgent))
{
user.UserAgent = userAgent;
}
await database.SaveChangesAsync();