mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
server: username isn't too long to fit token
This commit is contained in:
parent
89ece7fb45
commit
d3fef15c56
2 changed files with 3 additions and 1 deletions
|
@ -80,6 +80,8 @@ func (gmx *Gomuks) LoadConfig() error {
|
||||||
_, err = fmt.Scanln(&gmx.Config.Web.Username)
|
_, err = fmt.Scanln(&gmx.Config.Web.Username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to read username: %w", err)
|
return fmt.Errorf("failed to read username: %w", err)
|
||||||
|
} else if len(gmx.Config.Web.Username) == 0 || len(gmx.Config.Web.Username) > 32 {
|
||||||
|
return fmt.Errorf("username must be 1-32 characters long")
|
||||||
}
|
}
|
||||||
fmt.Print("Password: ")
|
fmt.Print("Password: ")
|
||||||
var passwd string
|
var passwd string
|
||||||
|
|
|
@ -83,7 +83,7 @@ type tokenData struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gmx *Gomuks) validateAuth(token string) bool {
|
func (gmx *Gomuks) validateAuth(token string) bool {
|
||||||
if len(token) > 100 {
|
if len(token) > 500 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
parts := strings.Split(token, ".")
|
parts := strings.Split(token, ".")
|
||||||
|
|
Loading…
Add table
Reference in a new issue