mirror of https://github.com/hykilpikonna/AquaDX
[F] Fix username check
parent
7ad4bc2ba5
commit
51af357c5a
|
@ -310,4 +310,6 @@ export const SETTING = {
|
|||
post('/api/v2/settings/get', {}),
|
||||
set: (key: string, value: any) =>
|
||||
post('/api/v2/settings/set', { key, value: `${value}` }),
|
||||
detailSet: (game: string, field: string, value: any) =>
|
||||
post(`/api/v2/game/${game}/user-detail-set`, { field, value }),
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ fun usernameCheck(chars: String): (IUserData, String) -> Unit = { u, v ->
|
|||
u.userName = v
|
||||
if (v.isBlank()) { 400 - "Username cannot be blank" }
|
||||
if (v.length > 8) { 400 - "Username too long" }
|
||||
v.find { it !in chars }?.let { 400 - "Invalid character '$it' in username" }
|
||||
// v.find { it !in chars }?.let { 400 - "Invalid character '$it' in username" }
|
||||
}
|
||||
|
||||
fun toFullWidth(input: String): String {
|
||||
|
|
|
@ -26,9 +26,7 @@ class Maimai2(
|
|||
// Only show > S rank
|
||||
override val shownRanks = mai2Scores.filter { it.first >= 97 * 10000 }
|
||||
override val settableFields: Map<String, (Mai2UserDetail, String) -> Unit> by lazy {
|
||||
mapOf(
|
||||
"userName" to usernameCheck(SEGA_USERNAME_CAHRS),
|
||||
)
|
||||
mapOf("userName" to usernameCheck(SEGA_USERNAME_CAHRS))
|
||||
}
|
||||
|
||||
override suspend fun userSummary(@RP username: Str, @RP token: String?) = us.cardByName(username) { card ->
|
||||
|
|
Loading…
Reference in New Issue