Update Supabase dependency, delete cookie handling, create logger
Updated Supabase dependency across multiple packages from "^2.41.1" to "^2.42.0". Removed files handling sidebar state and theme cookies. Created a new Logger interface for managing log messages in the shared package. Enhanced the middleware to track accounts membership webhook payload. Minor adjustments were also made in multiple package.json files.
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import { use } from 'react';
|
||||
|
||||
import { parseSidebarStateCookie } from '@kit/shared/cookies/sidebar-state.cookie';
|
||||
import { parseThemeCookie } from '@kit/shared/cookies/theme.cookie';
|
||||
import { Page } from '@kit/ui/page';
|
||||
|
||||
import { AccountLayoutSidebar } from '~/(dashboard)/home/[account]/_components/account-layout-sidebar';
|
||||
import { loadTeamWorkspace } from '~/(dashboard)/home/[account]/_lib/load-team-account-workspace';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import { AccountLayoutSidebar } from './_components/account-layout-sidebar';
|
||||
import { loadTeamWorkspace } from './_lib/load-team-account-workspace';
|
||||
|
||||
interface Params {
|
||||
account: string;
|
||||
}
|
||||
@@ -19,8 +18,6 @@ function TeamWorkspaceLayout({
|
||||
params: Params;
|
||||
}>) {
|
||||
const data = use(loadTeamWorkspace(params.account));
|
||||
const ui = getUIStateCookies();
|
||||
const sidebarCollapsed = ui.sidebarState === 'collapsed';
|
||||
|
||||
const accounts = data.accounts.map(({ name, slug, picture_url }) => ({
|
||||
label: name,
|
||||
@@ -32,7 +29,7 @@ function TeamWorkspaceLayout({
|
||||
<Page
|
||||
sidebar={
|
||||
<AccountLayoutSidebar
|
||||
collapsed={sidebarCollapsed}
|
||||
collapsed={false}
|
||||
account={params.account}
|
||||
accounts={accounts}
|
||||
/>
|
||||
@@ -44,10 +41,3 @@ function TeamWorkspaceLayout({
|
||||
}
|
||||
|
||||
export default withI18n(TeamWorkspaceLayout);
|
||||
|
||||
function getUIStateCookies() {
|
||||
return {
|
||||
theme: parseThemeCookie(),
|
||||
sidebarState: parseSidebarStateCookie(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { NextResponse, URLPattern } from 'next/server';
|
||||
|
||||
import csrf from 'edge-csrf';
|
||||
|
||||
import { Logger } from '@kit/shared/logger';
|
||||
import { checkRequiresMultiFactorAuthentication } from '@kit/supabase/check-requires-mfa';
|
||||
import { createMiddlewareClient } from '@kit/supabase/middleware-client';
|
||||
|
||||
@@ -21,6 +22,8 @@ export const config = {
|
||||
export async function middleware(request: NextRequest) {
|
||||
const response = NextResponse.next();
|
||||
|
||||
Logger.info({ name: `middleware`, message: `middleware` });
|
||||
|
||||
// apply CSRF and session middleware
|
||||
const csrfResponse = await withCsrfMiddleware(request, response);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"@kit/ui": "workspace:^",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@supabase/ssr": "^0.1.0",
|
||||
"@supabase/supabase-js": "^2.41.1",
|
||||
"@supabase/supabase-js": "^2.42.0",
|
||||
"@tanstack/react-query": "5.28.6",
|
||||
"@tanstack/react-query-next-experimental": "^5.28.14",
|
||||
"@tanstack/react-table": "^8.15.3",
|
||||
|
||||
Reference in New Issue
Block a user