Skip to content

Commit

Permalink
Add ExcludeCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Jul 2, 2022
1 parent 9785197 commit 9dea90a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/api/confighandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"net/http"

webauthnLib "github.com/duo-labs/webauthn/webauthn"
webauthnProtocol "github.com/duo-labs/webauthn/protocol"
"github.com/julienschmidt/httprouter"

"github.com/syncthing/syncthing/lib/config"
Expand Down Expand Up @@ -471,6 +472,12 @@ func (c *configMuxBuilder) startWebauthnRegistration(w http.ResponseWriter, r *h
}

c.webauthnState = *sessionData
for _, cred := range c.cfg.GUI().WebAuthnCredentials() {
options.Response.CredentialExcludeList = append(options.Response.CredentialExcludeList, webauthnProtocol.CredentialDescriptor{
Type: "public-key",
CredentialID: cred.ID,
})
}

sendJSON(w, options)
}
Expand Down

0 comments on commit 9dea90a

Please sign in to comment.