-
+
-
-
- {{ title }}
-
-
- {{ description }}
-
+
+
+
+ {{ title }}
+
+
+
+
+
+
+ {{ description }}
+
+
+
+
+
+
+
+
+
page.props.auth?.user);
+const { requireAuth, showAuthModal, authModalMessage } = useAuth();
const shareablePages = [
'Node',
@@ -20,43 +22,15 @@ const shouldShow = computed(() => shareablePages.includes(page.component));
const isMenuOpen = ref(false);
const isLoading = ref(false);
const isCopied = ref(false);
-const showAuthModal = ref(false);
const toolbarRef = ref(null);
-const getCsrfToken = (): string => {
- const match = document.cookie.match(/XSRF-TOKEN=([^;]+)/);
-
- return match ? decodeURIComponent(match[1]) : '';
-};
-
const copyToClipboard = async (text: string): Promise => {
- if (navigator.clipboard && window.isSecureContext) {
- try {
- await navigator.clipboard.writeText(text);
-
- return true;
- } catch {
- // Fall back to execCommand
- }
- }
-
- const textArea = document.createElement('textarea');
- textArea.value = text;
- textArea.style.position = 'fixed';
- textArea.style.left = '-999999px';
- document.body.appendChild(textArea);
- textArea.focus();
- textArea.select();
-
try {
- const ok = document.execCommand('copy');
- document.body.removeChild(textArea);
+ await navigator.clipboard.writeText(text);
- return ok;
+ return true;
} catch {
- document.body.removeChild(textArea);
-
return false;
}
};
@@ -85,9 +59,10 @@ const handleCopyLink = async () => {
return;
}
- if (!user.value) {
+ if (
+ !requireAuth('Please sign in to generate and copy short share links.')
+ ) {
closeMenu();
- showAuthModal.value = true;
return;
}
@@ -233,9 +208,5 @@ onBeforeUnmount(() => {
-
+
diff --git a/resources/js/components/NavBar.vue b/resources/js/components/NavBar.vue
index 5a271df9..7b1f16f3 100644
--- a/resources/js/components/NavBar.vue
+++ b/resources/js/components/NavBar.vue
@@ -73,14 +73,6 @@ const isHomeActive = computed(
currentUrl.value.startsWith('/ssc?'),
);
-const isHomeOrSsc = computed(
- () =>
- currentUrl.value === '/' ||
- currentUrl.value.startsWith('/?') ||
- currentUrl.value === '/ssc' ||
- currentUrl.value.startsWith('/ssc?'),
-);
-
const loginUrl = computed(() => {
const path = currentUrl.value;
@@ -368,7 +360,7 @@ onBeforeUnmount(() => {