mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: remove username length limit
This commit is contained in:
1 parent
b09aa0debf
commit
a5896e7c15
4 files changed
+11
-14
No files matched your search
@@ -6,11 +6,11 @@ import { TooManyRequestsError, ValidationError } from '../utils/errors'
|
||||
import { checkUsername, chooseUsername } from '../utils/auth'
|
||||
|
||||
async function check({ username, error }) {
|
||||
if (username && !isValidUsername(username)) {
|
||||
error('Invalid username.')
|
||||
return
|
||||
}
|
||||
if (username.length > 3) {
|
||||
if (username) {
|
||||
if (!isValidUsername(username)) {
|
||||
error('Invalid username.')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await checkUsername(username)
|
||||
} catch (err) {
|
||||
|
||||
@@ -48,9 +48,6 @@ async function check({ username, email, password, error }) {
|
||||
)
|
||||
return
|
||||
}
|
||||
if (!(username && email && password)) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await checkUsername(username)
|
||||
} catch (err) {
|
||||
|
||||
Reference in new issue
Block a user