Merge pull request #1904 from thecodingmachine/HotFixToEnableFreemiumLimitation

Enable limitation freemium
This commit is contained in:
grégoire parant
2022-02-18 22:19:44 +01:00
committed by GitHub
5 changed files with 16 additions and 11 deletions
@@ -4,23 +4,20 @@
import { ADMIN_URL } from "../../Enum/EnvironmentVariable"; import { ADMIN_URL } from "../../Enum/EnvironmentVariable";
import LL from "../../i18n/i18n-svelte"; import LL from "../../i18n/i18n-svelte";
const upgradeLink = ADMIN_URL + "/pricing";
const registerLink = ADMIN_URL + "/second-step-register"; const registerLink = ADMIN_URL + "/second-step-register";
</script> </script>
<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()}</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 -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: "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 -2
View File
@@ -1,9 +1,11 @@
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;
} }