aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auth
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2023-01-11 21:51:00 -0500
committerGitHub <noreply@github.com>2023-01-11 21:51:00 -0500
commit6f231a7980dd22f686c04d86fb79e1885ad31f6a (patch)
treee33f60ed34d664b70d3ca9c32834b24494d4279d /modules/auth
parent2220e5d2455b28450e2f505152f9fbb8ac597e80 (diff)
downloadgitea-6f231a7980dd22f686c04d86fb79e1885ad31f6a.tar.gz
gitea-6f231a7980dd22f686c04d86fb79e1885ad31f6a.zip
Replace deprecated Webauthn library (#22400)
Fix #22052 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/auth')
-rw-r--r--modules/auth/webauthn/webauthn.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/auth/webauthn/webauthn.go b/modules/auth/webauthn/webauthn.go
index ec60a86100..d08f7bf7cc 100644
--- a/modules/auth/webauthn/webauthn.go
+++ b/modules/auth/webauthn/webauthn.go
@@ -6,14 +6,13 @@ package webauthn
import (
"encoding/binary"
"encoding/gob"
- "net/url"
"code.gitea.io/gitea/models/auth"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/setting"
- "github.com/duo-labs/webauthn/protocol"
- "github.com/duo-labs/webauthn/webauthn"
+ "github.com/go-webauthn/webauthn/protocol"
+ "github.com/go-webauthn/webauthn/webauthn"
)
// WebAuthn represents the global WebAuthn instance
@@ -23,13 +22,13 @@ var WebAuthn *webauthn.WebAuthn
func Init() {
gob.Register(&webauthn.SessionData{})
- appURL, _ := url.Parse(setting.AppURL)
+ appURL, _ := protocol.FullyQualifiedOrigin(setting.AppURL)
WebAuthn = &webauthn.WebAuthn{
Config: &webauthn.Config{
RPDisplayName: setting.AppName,
RPID: setting.Domain,
- RPOrigin: protocol.FullyQualifiedOrigin(appURL),
+ RPOrigin: appURL,
AuthenticatorSelection: protocol.AuthenticatorSelection{
UserVerification: "discouraged",
},