about summary refs log tree commit diff
path: root/assets/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'assets/src/utils')
-rw-r--r--assets/src/utils/getShareToken.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/assets/src/utils/getShareToken.ts b/assets/src/utils/getShareToken.ts
index bfe6f58..b470695 100644
--- a/assets/src/utils/getShareToken.ts
+++ b/assets/src/utils/getShareToken.ts
@@ -1,4 +1,12 @@
-export default (): string => {
+import { isClientRequest } from "../stores/constant_state";
+
+export default function (): string {
+    if (!isClientRequest()) {
+        throw new Error(
+            "Client is not requesting so it does not have a share token."
+        );
+    }
+
     const splitPath = window.location.pathname.split("/");
     return splitPath[splitPath.length - 1];
-};
+}