mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-06 04:59:30 -06:00
phew big stuff!!!!
This commit is contained in:
parent
13d4fda7fa
commit
8014c9c5df
19 changed files with 689 additions and 57 deletions
|
|
@ -50,8 +50,8 @@ var (
|
|||
NewUsernameRegex = regexp.MustCompile(NewUsernameRegexString)
|
||||
)
|
||||
|
||||
// ValidateSignUpPassword returns an error if the given password is not sufficiently strong, or nil if it's ok.
|
||||
func ValidateSignUpPassword(password string) error {
|
||||
// ValidateNewPassword returns an error if the given password is not sufficiently strong, or nil if it's ok.
|
||||
func ValidateNewPassword(password string) error {
|
||||
if password == "" {
|
||||
return errors.New("no password provided")
|
||||
}
|
||||
|
|
@ -63,9 +63,9 @@ func ValidateSignUpPassword(password string) error {
|
|||
return pwv.Validate(password, MinimumPasswordEntropy)
|
||||
}
|
||||
|
||||
// ValidateSignUpUsername makes sure that a given username is valid (ie., letters, numbers, underscores, check length).
|
||||
// ValidateUsername makes sure that a given username is valid (ie., letters, numbers, underscores, check length).
|
||||
// Returns an error if not.
|
||||
func ValidateSignUpUsername(username string) error {
|
||||
func ValidateUsername(username string) error {
|
||||
if username == "" {
|
||||
return errors.New("no username provided")
|
||||
}
|
||||
|
|
@ -127,3 +127,13 @@ func ValidateSignUpReason(reason string, reasonRequired bool) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func ValidateDisplayName(displayName string) error {
|
||||
// TODO: add some validation logic here -- length, characters, etc
|
||||
return nil
|
||||
}
|
||||
|
||||
func ValidateNote(note string) error {
|
||||
// TODO: add some validation logic here -- length, characters, etc
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue