From 5cb831e848898aa37aa4de573188c57409f3b290 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Thu, 16 Jan 2025 16:00:35 +0330 Subject: [PATCH] Add auth for chat --- .../product/ChatBox/ChatBoxContainer.vue | 90 ++++++++++--------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/frontend/components/product/ChatBox/ChatBoxContainer.vue b/frontend/components/product/ChatBox/ChatBoxContainer.vue index a0c2d63..cedb98c 100644 --- a/frontend/components/product/ChatBox/ChatBoxContainer.vue +++ b/frontend/components/product/ChatBox/ChatBoxContainer.vue @@ -7,6 +7,7 @@ import ChatInput from "~/components/product/ChatBox/ChatInput.vue"; import { useIsMutating } from "@tanstack/vue-query"; import { MUTATION_KEYS } from "~/constants"; import CloseButton from "~/components/product/ChatBox/CloseButton.vue"; +import { useAuth } from "~/composables/api/auth/useAuth"; // provide-inject @@ -14,6 +15,8 @@ const { isOpen } = inject("isOpen") as any; // state +const { isLoggedIn } = useAuth(); + const route = useRoute(); const id = route.params.id as string | number; @@ -126,55 +129,62 @@ whenever( > - -
+ +
+ Please sign in first +