diff --git a/src/index.ts b/src/index.ts
index 554ce3e..6270273 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -127,8 +127,8 @@ interface DebugSettings {
interface SDKConfig {
clientSdkApiKey: string;
webauthnClientId: string;
- registerRedirectUrl: string;
- authenticationRedirectUrl: string;
+ registerRedirectUrl?: string;
+ authenticationRedirectUrl?: string;
getNonce?: () => string;
debug?: DebugSettings;
}
@@ -207,8 +207,8 @@ class SDK {
constructor({
clientSdkApiKey = "",
webauthnClientId = "",
- registerRedirectUrl = "",
- authenticationRedirectUrl = "",
+ registerRedirectUrl,
+ authenticationRedirectUrl,
getNonce,
debug = { url: "https://auth.autharmor.dev" }
}: SDKConfig) {
@@ -470,7 +470,10 @@ class SDK {
if (type === "success") {
if (loadingText) {
- loadingText.innerHTML = `Authenticated!
Please wait...`;
+ loadingText.insertAdjacentHTML(
+ "beforeend",
+ `Authenticated!
Please wait...`
+ );
}
return;
@@ -583,7 +586,9 @@ class SDK {
};
private init = () => {
- document.body.innerHTML += `
+ document.body?.insertAdjacentHTML(
+ "beforeend",
+ `
An error has occurred while communicating with the AuthArmor API, please make sure you've added the following domain to the allowed - domains list: "${location.host}" + domains list: "${window.location.host}"
Choose another method