When registering a webauthn credential fails the internal error is overridden and therefore not returned.
Implementation
The error is overridden by an auditLogger error, now the auditLog error is now assigned to a new variable instead.
Tests
Create a webauthn config where origins is not set correct (e.g. "https://example.com") and try to register a new webauthn credential. Before the fix the error on the logs on show code=400, message=failed to validate attestation. With the fix it should include the internal error code=400, message=failed to validate attestation, internal=Error validating origin
Description
When registering a webauthn credential fails the internal error is overridden and therefore not returned.
Implementation
The error is overridden by an auditLogger error, now the auditLog error is now assigned to a new variable instead.
Tests
Create a webauthn config where
origins
is not set correct (e.g. "https://example.com") and try to register a new webauthn credential. Before the fix the error on the logs on showcode=400, message=failed to validate attestation
. With the fix it should include the internal errorcode=400, message=failed to validate attestation, internal=Error validating origin