From aaccace72a122f9ae318e2ada7e879ce2e9af161 Mon Sep 17 00:00:00 2001 From: Henry <2671230065@qq.com> Date: Mon, 1 Apr 2024 22:19:10 +0800 Subject: [PATCH] fix(authn): subfolder api is considered as a wrong origin --- 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 df1d1fc6ff2..ea621d048af 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" }) }