From 0ea57fdd7d9f9b1ce23a861fbeef90a257e2f125 Mon Sep 17 00:00:00 2001 From: Fasjeit <15075638+Fasjeit@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:05:28 +0300 Subject: [PATCH] Fixing demo project makeAssertionOptions.status processing (#551) --- Demo/wwwroot/js/custom.login.js | 4 ++-- Demo/wwwroot/js/custom.register.js | 4 ++-- Demo/wwwroot/js/mfa.login.js | 4 ++-- Demo/wwwroot/js/mfa.register.js | 4 ++-- Demo/wwwroot/js/passwordless.login.js | 4 ++-- Demo/wwwroot/js/passwordless.register.js | 4 ++-- Demo/wwwroot/js/usernameless.login.js | 4 ++-- Demo/wwwroot/js/usernameless.register.js | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Demo/wwwroot/js/custom.login.js b/Demo/wwwroot/js/custom.login.js index 6623567c..20cf9273 100644 --- a/Demo/wwwroot/js/custom.login.js +++ b/Demo/wwwroot/js/custom.login.js @@ -30,7 +30,7 @@ async function handleSignInSubmit(event) { console.log("Assertion Options Object", makeAssertionOptions); // show options error to user - if (makeAssertionOptions.status !== "ok") { + if (makeAssertionOptions.status === "error") { console.log("Error creating assertion options"); console.log(makeAssertionOptions.errorMessage); showErrorAlert(makeAssertionOptions.errorMessage); @@ -117,7 +117,7 @@ async function verifyAssertionWithServer(assertedCredential) { console.log("Assertion Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error doing assertion"); console.log(response.errorMessage); showErrorAlert(response.errorMessage); diff --git a/Demo/wwwroot/js/custom.register.js b/Demo/wwwroot/js/custom.register.js index 0801bed6..c2e35ae4 100644 --- a/Demo/wwwroot/js/custom.register.js +++ b/Demo/wwwroot/js/custom.register.js @@ -41,7 +41,7 @@ async function handleRegisterSubmit(event) { console.log("Credential Options Object", makeCredentialOptions); - if (makeCredentialOptions.status !== "ok") { + if (makeCredentialOptions.status === "error") { console.log("Error creating credential options"); console.log(makeCredentialOptions.errorMessage); showErrorAlert(makeCredentialOptions.errorMessage); @@ -140,7 +140,7 @@ async function registerNewCredential(newCredential) { console.log("Credential Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error creating credential"); console.log(response.errorMessage); showErrorAlert(response.errorMessage); diff --git a/Demo/wwwroot/js/mfa.login.js b/Demo/wwwroot/js/mfa.login.js index 9fd63aac..82a8c28c 100644 --- a/Demo/wwwroot/js/mfa.login.js +++ b/Demo/wwwroot/js/mfa.login.js @@ -35,7 +35,7 @@ async function handleSignInSubmit(event) { console.log("Assertion Options Object", makeAssertionOptions); // show options error to user - if (makeAssertionOptions.status !== "ok") { + if (makeAssertionOptions.status === "error") { console.log("Error creating assertion options"); console.log(makeAssertionOptions.errorMessage); showErrorAlert(makeAssertionOptions.errorMessage); @@ -122,7 +122,7 @@ async function verifyAssertionWithServer(assertedCredential) { console.log("Assertion Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error doing assertion"); console.log(response.errorMessage); showErrorAlert(response.errorMessage); diff --git a/Demo/wwwroot/js/mfa.register.js b/Demo/wwwroot/js/mfa.register.js index f3dd567d..382cbe32 100644 --- a/Demo/wwwroot/js/mfa.register.js +++ b/Demo/wwwroot/js/mfa.register.js @@ -45,7 +45,7 @@ async function handleRegisterSubmit(event) { console.log("Credential Options Object", makeCredentialOptions); - if (makeCredentialOptions.status !== "ok") { + if (makeCredentialOptions.status === "error") { console.log("Error creating credential options"); console.log(makeCredentialOptions.errorMessage); showErrorAlert(makeCredentialOptions.errorMessage); @@ -145,7 +145,7 @@ async function registerNewCredential(newCredential) { console.log("Credential Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error creating credential"); console.log(response.errorMessage); showErrorAlert(response.errorMessage); diff --git a/Demo/wwwroot/js/passwordless.login.js b/Demo/wwwroot/js/passwordless.login.js index 9e6c62cf..49b22914 100644 --- a/Demo/wwwroot/js/passwordless.login.js +++ b/Demo/wwwroot/js/passwordless.login.js @@ -28,7 +28,7 @@ async function handleSignInSubmit(event) { console.log("Assertion Options Object", makeAssertionOptions); // show options error to user - if (makeAssertionOptions.status !== "ok") { + if (makeAssertionOptions.status === "error") { console.log("Error creating assertion options"); console.log(makeAssertionOptions.errorMessage); showErrorAlert(makeAssertionOptions.errorMessage); @@ -115,7 +115,7 @@ async function verifyAssertionWithServer(assertedCredential) { console.log("Assertion Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error doing assertion"); console.log(response.errorMessage); showErrorAlert(response.errorMessage); diff --git a/Demo/wwwroot/js/passwordless.register.js b/Demo/wwwroot/js/passwordless.register.js index 65ffd7bf..d6b515ce 100644 --- a/Demo/wwwroot/js/passwordless.register.js +++ b/Demo/wwwroot/js/passwordless.register.js @@ -42,7 +42,7 @@ async function handleRegisterSubmit(event) { console.log("Credential Options Object", makeCredentialOptions); - if (makeCredentialOptions.status !== "ok") { + if (makeCredentialOptions.status === "error") { console.log("Error creating credential options"); console.log(makeCredentialOptions.errorMessage); showErrorAlert(makeCredentialOptions.errorMessage); @@ -142,7 +142,7 @@ async function registerNewCredential(newCredential) { console.log("Credential Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error creating credential"); console.log(response.errorMessage); showErrorAlert(response.errorMessage); diff --git a/Demo/wwwroot/js/usernameless.login.js b/Demo/wwwroot/js/usernameless.login.js index 93ea7276..83095137 100644 --- a/Demo/wwwroot/js/usernameless.login.js +++ b/Demo/wwwroot/js/usernameless.login.js @@ -28,7 +28,7 @@ async function handleSignInSubmit(event) { console.log("Assertion Options Object", makeAssertionOptions); // show options error to user - if (makeAssertionOptions.status !== "ok") { + if (makeAssertionOptions.status === "error") { console.log("Error creating assertion options"); console.log(makeAssertionOptions.errorMessage); showErrorAlert(makeAssertionOptions.errorMessage); @@ -117,7 +117,7 @@ async function verifyAssertionWithServer(assertedCredential) { console.log("Assertion Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error doing assertion"); console.log(response.errorMessage); showErrorAlert(response.errorMessage); diff --git a/Demo/wwwroot/js/usernameless.register.js b/Demo/wwwroot/js/usernameless.register.js index bd48f88d..581425b6 100644 --- a/Demo/wwwroot/js/usernameless.register.js +++ b/Demo/wwwroot/js/usernameless.register.js @@ -43,7 +43,7 @@ async function handleRegisterSubmit(event) { console.log("Credential Options Object", makeCredentialOptions); - if (makeCredentialOptions.status !== "ok") { + if (makeCredentialOptions.status === "error") { console.log("Error creating credential options"); console.log(makeCredentialOptions.errorMessage); showErrorAlert(makeCredentialOptions.errorMessage); @@ -143,7 +143,7 @@ async function registerNewCredential(newCredential) { console.log("Credential Object", response); // show error - if (response.status !== "ok") { + if (response.status === "error") { console.log("Error creating credential"); console.log(response.errorMessage); showErrorAlert(response.errorMessage);