mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 22:10:57 +08:00
style(backend): go fmt code
This commit is contained in:
@@ -61,7 +61,7 @@ func GenerateOTPSecret() (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
||||
key, err := totp.Generate(totp.GenerateOpts{
|
||||
Issuer: OTPIssuer,
|
||||
AccountName: uuid.New().String(),
|
||||
@@ -69,7 +69,7 @@ func GenerateOTPSecret() (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
||||
return key.Secret(), nil
|
||||
}
|
||||
|
||||
@@ -118,4 +118,4 @@ func ValidateJWT(tokenString string) (*Claims, error) {
|
||||
// GetOTPQRCodeURL 获取OTP二维码URL
|
||||
func GetOTPQRCodeURL(secret, email string) string {
|
||||
return fmt.Sprintf("otpauth://totp/%s:%s?secret=%s&issuer=%s", OTPIssuer, email, secret, OTPIssuer)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user