mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-27 18:11:57 +08:00
Feat: add read/write lock for authn
This commit is contained in:
@@ -4,12 +4,16 @@ import (
|
||||
model "github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/util"
|
||||
"github.com/duo-labs/webauthn/webauthn"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var AuthnInstance *webauthn.WebAuthn
|
||||
var Lock sync.RWMutex
|
||||
|
||||
// Init 初始化webauthn
|
||||
func Init() {
|
||||
Lock.Lock()
|
||||
defer Lock.Unlock()
|
||||
var err error
|
||||
base := model.GetSiteURL()
|
||||
AuthnInstance, err = webauthn.New(&webauthn.Config{
|
||||
|
||||
Reference in New Issue
Block a user