@@ -378,14 +378,6 @@ func (u *DynamoUser) FinishLogin(r *http.Request) (*webauthn.Credential, error)
378
378
return credential , nil
379
379
}
380
380
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
-
389
381
// User ID according to the Relying Party
390
382
func (u * DynamoUser ) WebAuthnID () []byte {
391
383
return []byte (u .ID )
@@ -489,3 +481,13 @@ func hashAndEncodeKeyHandle(id []byte) string {
489
481
hash := sha256 .Sum256 (id )
490
482
return base64 .RawURLEncoding .EncodeToString (hash [:])
491
483
}
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