diff --git a/samples/samples-aspnet/embedded-auth-with-sdk/embedded-auth-with-sdk/Views/Manage/EnrollWebAuthnAuthenticator.cshtml b/samples/samples-aspnet/embedded-auth-with-sdk/embedded-auth-with-sdk/Views/Manage/EnrollWebAuthnAuthenticator.cshtml index e0f3b587..eca90cfe 100644 --- a/samples/samples-aspnet/embedded-auth-with-sdk/embedded-auth-with-sdk/Views/Manage/EnrollWebAuthnAuthenticator.cshtml +++ b/samples/samples-aspnet/embedded-auth-with-sdk/embedded-auth-with-sdk/Views/Manage/EnrollWebAuthnAuthenticator.cshtml @@ -57,8 +57,12 @@ fetch("@Url.Action("EnrollWebAuthnAuthenticatorAsync", "Manage")", options) .then(res => { - console.log("Request successful! Response:", res); - location.href = '@Url.Action("EnrollWebAuthnAuthenticator", "Manage", new { verificationCompleted = true})'; + if (res.ok) { + console.log("Request successful! Response:", res); + location.href = '@Url.Action("EnrollWebAuthnAuthenticator", "Manage", new { verificationCompleted = true })'; + } else { + throw "There was an error when enrolling webAuthn"; + } }).catch(function(err) { console.error(err); }