修复freeotp扫码问题

This commit is contained in:
bjdgyc 2021-07-22 19:25:05 +08:00
parent 35c6d80c8d
commit eec3006b35
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"strings"
"text/template"
@ -141,7 +142,7 @@ func UserOtpQr(w http.ResponseWriter, r *http.Request) {
return
}
issuer := base.Cfg.Issuer
issuer := url.QueryEscape(base.Cfg.Issuer)
qrstr := fmt.Sprintf("otpauth://totp/%s:%s?issuer=%s&secret=%s", issuer, user.Email, issuer, user.OtpSecret)
qr, _ := qrcode.New(qrstr, qrcode.High)