fix(auth): alphanumeric passwords only, no special chars

This commit is contained in:
Claus Lohmar 2026-06-14 17:28:08 +00:00
parent 19ae62da45
commit 461a9a7249

View file

@ -196,7 +196,7 @@ func containsGroup(groups, target string) bool {
// generatePassword creates a cryptographically secure random password. // generatePassword creates a cryptographically secure random password.
func generatePassword(length int) (string, error) { func generatePassword(length int) (string, error) {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*-_" const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
result := make([]byte, length) result := make([]byte, length)
for i := range result { for i := range result {
n, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset)))) n, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset))))