Skip to content

Commit

Permalink
Merge pull request #32 from cloudfoundry-community/no-leading-dashes
Browse files Browse the repository at this point in the history
If the first character is a dash, try again.
  • Loading branch information
LinuxBozo committed Mar 5, 2018
2 parents ef0b3a8 + f43273b commit 6f02b5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion password.go
Expand Up @@ -20,7 +20,8 @@ func GenerateSecurePassword(n int) string {
if err != nil {
continue
}
if p.Upper > 0 || p.Lower > 0 || p.Number > 0 || p.Special > 0 {
if p.Password[0] != '-' &&
(p.Upper > 0 || p.Lower > 0 || p.Number > 0 || p.Special > 0) {
return p.Password
}
}
Expand Down

0 comments on commit 6f02b5c

Please sign in to comment.