create-mercato-app 0.6.2-develop.3461.1.605f31c2c9 → 0.6.2-develop.3467.1.2a1818709d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -106,6 +106,7 @@ export default async function BackendLayout({
|
|
|
106
106
|
rightHeaderSlot={(
|
|
107
107
|
<BackendHeaderChrome
|
|
108
108
|
email={auth?.email}
|
|
109
|
+
userId={auth?.sub ?? null}
|
|
109
110
|
embeddingConfigured={embeddingConfigured}
|
|
110
111
|
missingConfigMessage={missingConfigMessage}
|
|
111
112
|
tenantId={auth?.tenantId ?? null}
|
|
@@ -5,6 +5,7 @@ import Link from 'next/link'
|
|
|
5
5
|
import * as React from 'react'
|
|
6
6
|
import { MoreHorizontal, PlugZap, Settings, Mail } from 'lucide-react'
|
|
7
7
|
import { hasFeature } from '@open-mercato/shared/security/features'
|
|
8
|
+
import { AuthSessionGuard } from '@open-mercato/ui/backend/AuthSessionGuard'
|
|
8
9
|
import { IconButton } from '@open-mercato/ui/primitives/icon-button'
|
|
9
10
|
import { Popover, PopoverContent, PopoverTrigger } from '@open-mercato/ui/primitives/popover'
|
|
10
11
|
import { IntegrationsButton } from '@open-mercato/ui/backend/IntegrationsButton'
|
|
@@ -37,6 +38,7 @@ const LazyMessagesIcon = dynamic(
|
|
|
37
38
|
|
|
38
39
|
type BackendHeaderChromeProps = {
|
|
39
40
|
email?: string
|
|
41
|
+
userId: string | null
|
|
40
42
|
embeddingConfigured: boolean
|
|
41
43
|
missingConfigMessage: string
|
|
42
44
|
tenantId: string | null
|
|
@@ -102,6 +104,7 @@ function MobileMoreMenu({ items }: { items: MobileMoreItem[] }) {
|
|
|
102
104
|
|
|
103
105
|
export function BackendHeaderChrome({
|
|
104
106
|
email,
|
|
107
|
+
userId,
|
|
105
108
|
embeddingConfigured,
|
|
106
109
|
missingConfigMessage,
|
|
107
110
|
tenantId,
|
|
@@ -160,6 +163,7 @@ export function BackendHeaderChrome({
|
|
|
160
163
|
|
|
161
164
|
return (
|
|
162
165
|
<>
|
|
166
|
+
<AuthSessionGuard serverUserId={userId} />
|
|
163
167
|
{isReady && showAiAssistant ? (
|
|
164
168
|
<AiAssistantShellIntegration tenantId={tenantId} organizationId={organizationId}>
|
|
165
169
|
<LazyAiChatHeaderButton />
|
|
@@ -39,6 +39,10 @@ jest.mock('@open-mercato/ui/backend/SettingsButton', () => ({
|
|
|
39
39
|
SettingsButton: () => <div data-testid="settings-button" />,
|
|
40
40
|
}))
|
|
41
41
|
|
|
42
|
+
jest.mock('@open-mercato/ui/backend/AuthSessionGuard', () => ({
|
|
43
|
+
AuthSessionGuard: () => <div data-testid="auth-session-guard" />,
|
|
44
|
+
}))
|
|
45
|
+
|
|
42
46
|
jest.mock('@/components/AiAssistantShellIntegration', () => ({
|
|
43
47
|
AiAssistantShellIntegration: ({ children }: { children: React.ReactNode }) => <>{children}</>,
|
|
44
48
|
}))
|
|
@@ -48,6 +52,7 @@ describe('BackendHeaderChrome', () => {
|
|
|
48
52
|
const { container } = render(
|
|
49
53
|
<BackendHeaderChrome
|
|
50
54
|
email="demo@example.com"
|
|
55
|
+
userId="user-1"
|
|
51
56
|
embeddingConfigured={false}
|
|
52
57
|
missingConfigMessage=""
|
|
53
58
|
tenantId={null}
|