Enable limitation freemium

- Fix warning message
 - Fix post message API pusher

Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
Gregoire Parant
2022-02-18 21:33:23 +01:00
parent 7820c6b964
commit 3a734cc2ae
5 changed files with 16 additions and 8 deletions
@@ -11,16 +11,14 @@
<main class="warningMain" transition:fly={{ y: -200, duration: 500 }}> <main class="warningMain" transition:fly={{ y: -200, duration: 500 }}>
{#if $userIsAdminStore} {#if $userIsAdminStore}
<h2>{$LL.warning.title()}</h2> <h2>{$LL.warning.title()}</h2>
<p> <p>{@html $LL.warning.content({ upgradeLink })}</p>
{$LL.warning.content({ upgradeLink })}
</p>
{:else if $limitMapStore} {:else if $limitMapStore}
<p> <p>
This map is available for 2 days. You can register your domain <a href={registerLink}>here</a>! This map is available for 2 days. You can register your domain <a href={registerLink}>here</a>!
</p> </p>
{:else} {:else}
<h2>{$LL.warning.title()}</h2> <h2>{$LL.warning.title()}</h2>
<p>{$LL.warning.limit()}</p> <p>{@html $LL.warning.content()}</p>
{/if} {/if}
</main> </main>
+4 -1
View File
@@ -1,9 +1,12 @@
import type { Translation } from "../i18n-types"; import type { Translation } from "../i18n-types";
import {ADMIN_URL} from "../../Enum/EnvironmentVariable";
const upgradeLink = ADMIN_URL + "/pricing";
const warning: NonNullable<Translation["warning"]> = { const warning: NonNullable<Translation["warning"]> = {
title: "Warnung!", title: "Warnung!",
content: content:
'Diese Welt erreicht bald die maximale Kapazität. Du kannst die Kapazität <a href={upgradeLink} target="_blank">hier</a> erhöhen', `Diese Welt erreicht bald die maximale Kapazität. Du kannst die Kapazität <a href="${upgradeLink}" target="_blank">hier</a> erhöhen`,
limit: "Diese Welt erreicht bald die maximale Kapazität!", limit: "Diese Welt erreicht bald die maximale Kapazität!",
accessDenied: { accessDenied: {
camera: "Zugriff auf die Kamera verweigert. Hier klicken um deine Browser Berechtigungen zu prüfen.", camera: "Zugriff auf die Kamera verweigert. Hier klicken um deine Browser Berechtigungen zu prüfen.",
+4 -1
View File
@@ -1,9 +1,12 @@
import type { BaseTranslation } from "../i18n-types"; import type { BaseTranslation } from "../i18n-types";
import {ADMIN_URL} from "../../Enum/EnvironmentVariable";
const upgradeLink = ADMIN_URL + "/pricing";
const warning: BaseTranslation = { const warning: BaseTranslation = {
title: "Warning!", title: "Warning!",
content: content:
'This world is close to its limit!. You can upgrade its capacity <a href={upgradeLink} target="_blank">here</a>', `This world is close to its limit!. You can upgrade its capacity <a href="${upgradeLink}" target="_blank">here</a>`,
limit: "This world is close to its limit!", limit: "This world is close to its limit!",
accessDenied: { accessDenied: {
camera: "Camera access denied. Click here and check your browser permissions.", camera: "Camera access denied. Click here and check your browser permissions.",
+4 -2
View File
@@ -1,9 +1,11 @@
import type { Translation } from "../i18n-types"; import type { Translation } from "../i18n-types";
import {ADMIN_URL} from "../../Enum/EnvironmentVariable";
const upgradeLink = ADMIN_URL + "/pricing";
const warning: NonNullable<Translation["warning"]> = { const warning: NonNullable<Translation["warning"]> = {
title: "Attention!", title: "Attention!",
content: content: `Ce monde est proche de sa limite ! Vous pouvez améliorer sa capacité <a href="${upgradeLink}" target="_blank">içi</a>`,
'Ce monde est proche de sa limite ! Vous pouvez améliorer sa capacité <a href={upgradeLink} target="_blank">içi</a>',
limit: "Ce monde est proche de ses limites!", limit: "Ce monde est proche de ses limites!",
accessDenied: { accessDenied: {
camera: "Accès à la caméra refusé. Cliquez ici et vérifiez les autorisations de votre navigateur.", camera: "Accès à la caméra refusé. Cliquez ici et vérifiez les autorisations de votre navigateur.",
+2
View File
@@ -84,11 +84,13 @@ export class AdminController extends BaseController {
if (ADMIN_API_TOKEN === "") { if (ADMIN_API_TOKEN === "") {
res.writeStatus("401 Unauthorized").end("No token configured!"); res.writeStatus("401 Unauthorized").end("No token configured!");
res.end();
return; return;
} }
if (token !== ADMIN_API_TOKEN) { if (token !== ADMIN_API_TOKEN) {
console.error("Admin access refused for token: " + token); console.error("Admin access refused for token: " + token);
res.writeStatus("401 Unauthorized").end("Incorrect token"); res.writeStatus("401 Unauthorized").end("Incorrect token");
res.end();
return; return;
} }