Replies: 3 comments 1 reply
-
|
Could you check if cryptography is available in the browser? Which browser are you using? Key verification uses the standard browser API (https://formengine.io/documentation/license-key ). In particular, this API is used https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle. Please duplicate your request for support@optimajet.com |
Beta Was this translation helpful? Give feedback.
-
|
Important! The licence check will work correctly either on localhost or under HTTPS. These are limitations of browser cryptography! |
Beta Was this translation helpful? Give feedback.
-
|
Hi @linesh98, This workaround should work. But it really is a workaround. The best approach is to use HTTPS everywhere, because it is a more secure and reliable environment. If the message still appears sometimes, then the workaround has not worked. Please create an example where this workaround does not work and send it to us at support@optimajet.com. We will try to help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a form builder integrated with my application, and I have applied the license key to it. It is working correctly in the local environment, where we are using HTTP only.
The application has now been deployed to the DEV and QA environments(Both HTTP), but the same warning errors still appear in both environments. Additionally, I can see the following message in the console: “License check failed, error: crypto.subtle is not available.”
// src/pages/private/form-builder/Designer.tsx
import { useCallback, useMemo } from "react";
import { FormBuilder, useFormBuilder, type BuilderView } from "@react-form-builder/designer";
import {
components as rsuiteComponents,
formEngineRsuiteCssLoader,
ltrCssLoader,
rtlCssLoader,
RsLocalizationWrapper,
rSuiteComponentsDescriptions,
} from "@react-form-builder/components-rsuite";
import { rSuiteTableComponentsDescriptions } from "@react-form-builder/components-rsuite-table";
import {
fastQrComponent,
fastQrComponentsDescriptions,
} from "@react-form-builder/components-fast-qr";
import {
googleMapComponent,
googleMapComponentsDescriptions,
} from "@react-form-builder/components-google-map";
import {
richTextComponent,
richTextEditorComponentsDescriptions,
} from "@react-form-builder/components-rich-text";
import {
signatureComponent,
signatureComponentsDescriptions,
} from "@react-form-builder/components-signature";
import { BiDi, BuilderView as CoreBuilderView } from "@react-form-builder/core";
import ButtonComponent from "../../../components/general/ButtonComponent";
import { voiceTextInput } from "./VoiceTextInputDef";
import { textEditor } from "./TextEditorDef";
/* -------------------------------------------------------------------------- /
/ Toggle Builder / Preview Mode Button /
/ -------------------------------------------------------------------------- */
const CustomToggleModeButton = () => {
const builder = useFormBuilder();
const label = builder.builderMode === "builder" ? "Preview Mode" : "Edit Mode";
const toggleMode = useCallback(() => {
const newMode = builder.builderMode === "builder" ? "viewer" : "builder";
builder.builderMode = newMode;
}, [builder]);
return {label};
};
/* -------------------------------------------------------------------------- /
/ Builder Customizations /
/ -------------------------------------------------------------------------- */
const builderCustomizations = {
JsonViewButton: { hidden: true },
MainMenu_Button: { hidden: true },
ResolutionSelect: { hidden: true },
ToggleThemeButton: { hidden: true },
Actions_Tab: { hidden: true },
Actions_Tab_Content: { hidden: true },
LocalizationSelect: { hidden: true },
ToggleModeButton: { hidden: true },
Header_Toolbar: { hidden: true },
MainMenu_Dropdown: {
style:
#menuitem-\\:r5\\:, #menuitem-\\:r6\\: { display: none; },},
Header: {
customRenderer: () => (
<>
<style>
{
.hidden-panel { display: none !important; }}</style>
<div
style={{
display: "flex",
justifyContent: "flex-end",
padding: "0.5rem",
}}
>
</>
),
},
};
/* -------------------------------------------------------------------------- /
/ Props /
/ -------------------------------------------------------------------------- */
interface DesignerProps {
onRefReady: (ref: any) => void;
onDataChange: (data: any) => void;
}
/* -------------------------------------------------------------------------- /
/ Designer Component /
/ -------------------------------------------------------------------------- */
export const Designer = ({ onRefReady, onDataChange }: DesignerProps) => {
/* ------------------------ Register ALL components ------------------------ */
const allComponents = useMemo(
() => [
...rsuiteComponents,
fastQrComponent.build(),
googleMapComponent.build(),
signatureComponent.build(),
richTextComponent.build(),
voiceTextInput.build(),
textEditor.build(),
],
[],
);
/* ------------------------- Create Builder View --------------------------- */
const view = useMemo(() => {
return (
new CoreBuilderView(allComponents)
.withViewerWrapper(RsLocalizationWrapper)
.withCssLoader(BiDi.LTR, ltrCssLoader)
.withCssLoader(BiDi.RTL, rtlCssLoader)
.withCssLoader("common", formEngineRsuiteCssLoader)
}, [allComponents]);
const licenseKey = import.meta.env.VITE_LICENSE_KEY;
return (
<FormBuilder
licenseKey={licenseKey}
view={view}
customization={builderCustomizations}
builderRef={(ref) => ref && onRefReady(ref)}
onFormDataChange={({ data }) => onDataChange(data)}
/>
);
};
Beta Was this translation helpful? Give feedback.
All reactions