[F] Fix username decoding

pull/29/head
Azalea 2024-03-26 18:51:17 -04:00
parent 40a65b5e13
commit d2cf16d046
1 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,9 @@ class UpsertUserAllHandler(
card = userData?.card ?: cardService.getCardByExtId(userId).orElseThrow()
isNetMember = 1
// Decode Username
userName = String(userName.toByteArray(Charsets.ISO_8859_1), Charsets.UTF_8)
// Verify user name
if (userName.isBlank() || userName.length > 8 || !userName.all { it in USERNAME_CHARS })
400 - "Invalid username"