29 lines
613 B
TypeScript
29 lines
613 B
TypeScript
import { createSecurity } from "@kri/common/security";
|
|
import { clientEnv } from "@/lib/env.client";
|
|
|
|
const KEY = "kr!-c0nTacT-fr0nT-CrypT0-Key-STR";
|
|
|
|
const IV = "kr!-c0nTacT-IVST";
|
|
|
|
export const Security = createSecurity({
|
|
key: KEY,
|
|
iv: IV,
|
|
|
|
onInvalidConfig: ({ message }) => {
|
|
if (typeof window === "undefined" || clientEnv.ENV !== "local") {
|
|
return;
|
|
}
|
|
|
|
const target = window as Window & {
|
|
__kfpaCryptoConfigAlerted?: boolean;
|
|
};
|
|
|
|
if (target.__kfpaCryptoConfigAlerted) {
|
|
return;
|
|
}
|
|
|
|
target.__kfpaCryptoConfigAlerted = true;
|
|
window.alert(message);
|
|
},
|
|
});
|