From 1756036a21af133a47d834dd121a47f0bb91a4ca Mon Sep 17 00:00:00 2001 From: itsHenry <2671230065@qq.com> Date: Wed, 3 Apr 2024 14:33:19 +0800 Subject: [PATCH] fix(authn): subfolder api is considered as a wrong origin(closes #6294 in #6301) --- internal/authn/authn.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/authn/authn.go b/internal/authn/authn.go index df1d1fc6..ea621d04 100644 --- a/internal/authn/authn.go +++ b/internal/authn/authn.go @@ -1,6 +1,7 @@ package authn import ( + "fmt" "net/http" "net/url" @@ -19,7 +20,7 @@ func NewAuthnInstance(r *http.Request) (*webauthn.WebAuthn, error) { RPDisplayName: setting.GetStr(conf.SiteTitle), RPID: siteUrl.Hostname(), //RPOrigin: siteUrl.String(), - RPOrigins: []string{siteUrl.String()}, + RPOrigins: []string{fmt.Sprintf("%s://%s", siteUrl.Scheme, siteUrl.Host)}, // RPOrigin: "http://localhost:5173" }) }