Cloudreve/pkg/authn/auth.go

22 lines
561 B
Go
Raw Normal View History

2019-12-08 22:17:36 +08:00
package authn
import (
"fmt"
"github.com/duo-labs/webauthn/webauthn"
)
var AuthnInstance *webauthn.WebAuthn
2019-12-08 22:17:36 +08:00
func Init() {
var err error
AuthnInstance, err = webauthn.New(&webauthn.Config{
2019-12-08 22:17:36 +08:00
RPDisplayName: "Duo Labs", // Display Name for your site
RPID: "localhost", // Generally the FQDN for your site
RPOrigin: "http://localhost:3000", // The origin URL for WebAuthn requests
RPIcon: "https://duo.com/logo.png", // Optional icon URL for your site
})
if err != nil {
fmt.Println(err)
}
}