fix(authn): subfolder api is considered as a wrong origin(closes #6294 in #6301)

pull/6305/head
itsHenry 2024-04-03 14:33:19 +08:00 committed by GitHub
parent 58c3cb3cf6
commit 1756036a21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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"
})
}