Skip to content

Commit

Permalink
Return Fido2VerificationException details to user (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashendrickx authored Nov 14, 2024
1 parent 79e5d25 commit 3fe5d8d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Service/Fido2Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,16 @@ public async Task<TokenResponse> SignInCompleteAsync(SignInCompleteDTO request,
StoredSignatureCounter = credential.SignatureCounter,
IsUserHandleOwnerOfCredentialIdCallback = callback
};
var res = await fido2.MakeAssertionAsync(makeAssertionParams);
VerifyAssertionResult res;

try
{
res = await fido2.MakeAssertionAsync(makeAssertionParams);
}
catch (Fido2VerificationException fido2VerificationException)
{
throw new ApiException("signin_complete_error", fido2VerificationException.Message, 400);
}

// Store the updated counter
await _storage.UpdateCredential(res.CredentialId, res.SignCount, country, device);
Expand Down

0 comments on commit 3fe5d8d

Please sign in to comment.