don't bother with string conversion for consts

This commit is contained in:
tobi 2025-04-07 14:52:23 +02:00
commit d84d73c050

View file

@ -27,7 +27,6 @@ import (
"io" "io"
"net/url" "net/url"
"sort" "sort"
"strconv"
"strings" "strings"
"time" "time"
@ -86,9 +85,9 @@ func totpURLForUser(user *gtsmodel.User) *url.URL {
v := url.Values{} v := url.Values{}
v.Set("secret", user.TwoFactorSecret) v.Set("secret", user.TwoFactorSecret)
v.Set("issuer", issuer) v.Set("issuer", issuer)
v.Set("period", strconv.FormatInt(30, 10)) v.Set("period", "30") // 30 seconds totp validity.
v.Set("algorithm", "SHA1") v.Set("algorithm", "SHA1")
v.Set("digits", strconv.FormatInt(6, 10)) v.Set("digits", "6") // 6-digit totp.
return &url.URL{ return &url.URL{
Scheme: "otpauth", Scheme: "otpauth",