Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: FE presents undetailed error message for username validation #1693

Closed
Assignees
oxy
Labels
siteArea: frontend dashboard
@greyscaled

Description

@greyscaled

This is a spawn-off of#1689 (thanks@oxy 🎉)

Steps to Reproduce

See#1689

Expected

A helpful error message regarding what letters/characters/combinations the username accepts

Actual

An undetailed error message

Screenshot

169904635-8063880a-6d28-45b1-836c-cce8ce82bc48

Notes

The Yup validation needs improvements here:

This usesusername validation, which is a custom validator we have in our backend.

To source this, see that the struct has ausername tag here:

Usernamestring`json:"username" validate:"required,username"`

Which is defined here:

err:=validate.RegisterValidation("username",func(fl validator.FieldLevel)bool {
f:=fl.Field().Interface()
str,ok:=f.(string)
if!ok {
returnfalse
}
iflen(str)>32 {
returnfalse
}
iflen(str)<1 {
returnfalse
}
returnusernameRegex.MatchString(str)
})

usernameRegex=regexp.MustCompile("^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$")

Metadata

Metadata

Assignees

Labels

siteArea: frontend dashboard

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp