fix: rendering of TOTP QR code (#7549)

(cherry picked from commit a28b3a1c2d)
This commit is contained in:
Livio Spring
2024-03-12 17:20:42 +01:00
parent 50b2ea6e1f
commit 5908b97e7c
2 changed files with 3 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package login
import ( import (
"bytes" "bytes"
"html/template"
"net/http" "net/http"
"github.com/zitadel/zitadel/internal/domain" "github.com/zitadel/zitadel/internal/domain"
@@ -76,7 +77,7 @@ func (l *Login) renderMFAInitVerify(w http.ResponseWriter, r *http.Request, auth
if data.MFAType == domain.MFATypeTOTP { if data.MFAType == domain.MFATypeTOTP {
code, err := generateQrCode(data.totpData.Url) code, err := generateQrCode(data.totpData.Url)
if err == nil { if err == nil {
data.totpData.QrCode = code data.totpData.QrCode = template.HTML(code)
} }
} }

View File

@@ -706,5 +706,5 @@ type mfaDoneData struct {
type totpData struct { type totpData struct {
Url string Url string
Secret string Secret string
QrCode string QrCode template.HTML
} }