.clean up the code

This commit is contained in:
429Enjoyer
2026-05-20 05:56:16 +07:00
parent b3ebef5ab9
commit 254022d81d
460 changed files with 0 additions and 51905 deletions
-28
View File
@@ -1,28 +0,0 @@
package backend
import (
"fmt"
"time"
"github.com/pquerna/otp"
"github.com/pquerna/otp/totp"
)
const (
spotifyTOTPSecret = "GM3TMMJTGYZTQNZVGM4DINJZHA4TGOBYGMZTCMRTGEYDSMJRHE4TEOBUG4YTCMRUGQ4DQOJUGQYTAMRRGA2TCMJSHE3TCMBY"
spotifyTOTPVersion = 61
)
func generateSpotifyTOTP(now time.Time) (string, int, error) {
key, err := otp.NewKeyFromURL(fmt.Sprintf("otpauth://totp/secret?secret=%s", spotifyTOTPSecret))
if err != nil {
return "", 0, err
}
code, err := totp.GenerateCode(key.Secret(), now)
if err != nil {
return "", 0, err
}
return code, spotifyTOTPVersion, nil
}