Skip to content

Commit

Permalink
set default to otp.DigitsSix
Browse files Browse the repository at this point in the history
  • Loading branch information
phylake committed Sep 5, 2016
1 parent 1ff6a76 commit bb0d604
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions totp/totp.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,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 bb0d604

Please sign in to comment.