Skip to content

Commit

Permalink
Merge pull request #31 from champkeh/hotp-digits-check
Browse files Browse the repository at this point in the history
check hotp key generation opts.Digits
  • Loading branch information
pquerna committed Aug 13, 2018
2 parents 7b7d3c7 + 7b09999 commit be78767
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hotp/hotp.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ func Generate(opts GenerateOpts) (*otp.Key, error) {
opts.SecretSize = 10
}

if opts.Digits == 0 {
opts.Digits = otp.DigitsSix
}

// otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example

v := url.Values{}
Expand Down

0 comments on commit be78767

Please sign in to comment.