@@ -378,14 +378,6 @@ func (u *DynamoUser) FinishLogin(r *http.Request) (*webauthn.Credential, error)
378378 return credential , nil
379379}
380380
381- // logProtocolError logs a message if the given error is an Error from go-webauthn/webauthn/protocol
382- func logProtocolError (msg string , err error ) {
383- var protocolError * protocol.Error
384- if errors .As (err , & protocolError ) {
385- log .Printf ("%s, ProtocolError: %s, DevInfo: %s" , msg , protocolError .Details , protocolError .DevInfo )
386- }
387- }
388-
389381// User ID according to the Relying Party
390382func (u * DynamoUser ) WebAuthnID () []byte {
391383 return []byte (u .ID )
@@ -489,3 +481,13 @@ func hashAndEncodeKeyHandle(id []byte) string {
489481 hash := sha256 .Sum256 (id )
490482 return base64 .RawURLEncoding .EncodeToString (hash [:])
491483}
484+
485+ // logProtocolError logs a detailed message if the given error is an Error from go-webauthn/webauthn/protocol
486+ func logProtocolError (msg string , err error ) {
487+ var protocolError * protocol.Error
488+ if errors .As (err , & protocolError ) {
489+ log .Printf ("%s, ProtocolError: %s, DevInfo: %s" , msg , protocolError .Details , protocolError .DevInfo )
490+ } else {
491+ log .Printf ("%s, Error: %s" , msg , err )
492+ }
493+ }
0 commit comments