From 3d20f59e6e0970809dd12098fd307bc72b2a1ba4 Mon Sep 17 00:00:00 2001 From: egregors Date: Thu, 8 Aug 2024 11:41:26 +0200 Subject: [PATCH] #16: fix "can't finish registration: Error validating origin" error --- _example/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/_example/main.go b/_example/main.go index c0d24f7..c6c4c4a 100644 --- a/_example/main.go +++ b/_example/main.go @@ -14,10 +14,11 @@ import ( const userKey = "pkUser" func main() { - proto := "http" - host := "localhost" - port := ":8080" - origin := fmt.Sprintf("%s://%s%s", proto, host, port) + proto := "http" // "http" | "https" + sub := "" // "" | "login." + host := "localhost" // "localhost" | "example.com" + port := ":8080" // port needs only for starting the server, WebauthnConfig.RPOrigins should not contain port + origin := fmt.Sprintf("%s://%s%s", proto, sub, host) storage := NewStorage()