Skip to content

Commit

Permalink
check hotp key generation opts.Digits
Browse files Browse the repository at this point in the history
  • Loading branch information
champkeh committed Aug 12, 2018
1 parent 7b7d3c7 commit 7b09999
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:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example

v := url.Values{}
Expand Down

0 comments on commit 7b09999

Please sign in to comment.