Documentation
¶
Index ¶
Constants ¶
View Source
const EmailStep = 2
View Source
const MaxUsernameLength = 20
View Source
const MinUsernameLength = 4
View Source
const PasswordConfirmationStep = 4
View Source
const PasswordEntropy = 40
View Source
const PasswordStep = 3
View Source
const UsernameRegex = `^[a-zA-Z0-9_]+$`
View Source
const UsernameStep = 1
Variables ¶
View Source
var AfterCreateCallback = func(sessId string, entityId string) error { return login_controller.Login(sessId, entityId) }
View Source
var Controller = controller{}
View Source
var PasswordValidator = func(password string) error { e := passwordvalidator.GetEntropy(password) if e < PasswordEntropy { return fmt.Errorf("That isn't a very secure password. Try something stronger.") } return nil }
View Source
var UsernameValidator = func(username string) error { r, err := regexp.Compile(UsernameRegex) if err != nil { panic(err) } if len(username) < MinUsernameLength { return fmt.Errorf( "'%s' is not a valid username. It must be at least %d characters long.", username, MinUsernameLength, ) } if len(username) >= MaxUsernameLength { return fmt.Errorf( "'%s' is not a valid username. It must be at most %d characters long.", username, MaxUsernameLength, ) } if !r.MatchString(username) { return fmt.Errorf( "'%s' is not a valid username. It must contain only alpha-numeric characters, dashes (-) or underscores (_)", username, ) } return nil }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.