Skip to content

Commit be78767

Browse files
authored
Merge pull request #31 from champkeh/hotp-digits-check
check hotp key generation opts.Digits
2 parents 7b7d3c7 + 7b09999 commit be78767

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: hotp/hotp.go

+4
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ func Generate(opts GenerateOpts) (*otp.Key, error) {
167167
opts.SecretSize = 10
168168
}
169169

170+
if opts.Digits == 0 {
171+
opts.Digits = otp.DigitsSix
172+
}
173+
170174
// otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example
171175

172176
v := url.Values{}

0 commit comments

Comments
 (0)