Compare commits

..

2 Commits

Author SHA1 Message Date
a46de4662c 🐛 Fix gateway 2025-11-30 17:51:27 +08:00
fdd14b860e 🐛 Fix wrong required status of validate account create request 2025-11-30 17:37:34 +08:00
2 changed files with 6 additions and 8 deletions

View File

@@ -107,7 +107,6 @@ public class AccountController(
public class AccountCreateValidateRequest
{
[Required]
[MinLength(2)]
[MaxLength(256)]
[RegularExpression(@"^[A-Za-z0-9_-]+$",
@@ -117,7 +116,6 @@ public class AccountController(
[EmailAddress]
[RegularExpression(@"^[^+]+@[^@]+\.[^@]+$", ErrorMessage = "Email address cannot contain '+' symbol.")]
[Required]
[MaxLength(1024)]
public string? Email { get; set; }
}

View File

@@ -42,8 +42,8 @@ public class WebSocketController(
var accountId = Guid.Parse(currentUser.Id!);
var deviceId = currentSession.Challenge?.DeviceId ?? Guid.NewGuid().ToString();
if (string.IsNullOrEmpty(deviceId))
return BadRequest("Unable to get device ID from session.");
// TODO temporary fix due to the server update
if (string.IsNullOrEmpty(deviceId)) deviceId = Guid.NewGuid().ToString().Replace("-", "");
if (deviceAlt is not null)
deviceId = $"{deviceId}+{deviceAlt}";
@@ -101,9 +101,9 @@ public class WebSocketController(
}
catch (WebSocketException ex)
when (ex.Message.Contains(
"The remote party closed the WebSocket connection without completing the close handshake"
)
)
"The remote party closed the WebSocket connection without completing the close handshake"
)
)
{
logger.LogDebug(
"WebSocket disconnected with user @{UserName}#{UserId} and device #{DeviceId} - client closed connection without proper handshake",
@@ -187,4 +187,4 @@ public class WebSocketController(
}
}
}
}
}