diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2024-09-20 11:11:53 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-20 11:11:53 +1000 |
| commit | c0d4dd9c9499b7e9b0f83c47396aa6a7da3424db (patch) | |
| tree | 2d5ca23021aacac96d656b680eb57cab00b1617e /internal/storage/sql_provider.go | |
| parent | 346acdcf43f715473874c7033421df04f7232e63 (diff) | |
refactor: linting (#7863)
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/storage/sql_provider.go')
| -rw-r--r-- | internal/storage/sql_provider.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/storage/sql_provider.go b/internal/storage/sql_provider.go index 7154a404e..21c84cfe2 100644 --- a/internal/storage/sql_provider.go +++ b/internal/storage/sql_provider.go @@ -561,7 +561,7 @@ func (p *SQLProvider) LoadTOTPConfiguration(ctx context.Context, username string // SaveTOTPHistory saves a TOTP history item in the storage provider. func (p *SQLProvider) SaveTOTPHistory(ctx context.Context, username string, step uint64) (err error) { - signature := p.otpHMACSignature([]byte(strconv.Itoa(int(step))), []byte(username)) + signature := p.otpHMACSignature([]byte(strconv.FormatUint(step, 10)), []byte(username)) if _, err = p.db.ExecContext(ctx, p.sqlInsertTOTPHistory, username, signature); err != nil { return fmt.Errorf("error inserting TOTP history for user '%s': %w", username, err) @@ -574,7 +574,7 @@ func (p *SQLProvider) SaveTOTPHistory(ctx context.Context, username string, step func (p *SQLProvider) ExistsTOTPHistory(ctx context.Context, username string, step uint64) (exists bool, err error) { var count int - signature := p.otpHMACSignature([]byte(strconv.Itoa(int(step))), []byte(username)) + signature := p.otpHMACSignature([]byte(strconv.FormatUint(step, 10)), []byte(username)) if err = p.db.GetContext(ctx, &count, p.sqlSelectTOTPHistory, username, signature); err != nil { return false, fmt.Errorf("error checking if TOTP history exists: %w", err) |
