feat: initial auth config
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"
|
||||
import { Toaster } from "@/components/ui/sonner"
|
||||
import DashboardSidebar from "@/dashboard/dashboard-sidebar"
|
||||
import "@/styles/globals.css"
|
||||
import { ConvexProviderWithAuthKit } from "@convex-dev/workos"
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
|
||||
import { createRootRoute, Outlet } from "@tanstack/react-router"
|
||||
import { TanStackRouterDevtools } from "@tanstack/router-devtools"
|
||||
import { ConvexProvider, ConvexReactClient } from "convex/react"
|
||||
import { AuthKitProvider, useAuth } from "@workos-inc/authkit-react"
|
||||
import { ConvexReactClient } from "convex/react"
|
||||
import { toast } from "sonner"
|
||||
import { formatError } from "@/lib/error"
|
||||
|
||||
@@ -29,18 +28,17 @@ const queryClient = new QueryClient({
|
||||
function RootLayout() {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ConvexProvider client={convexClient}>
|
||||
<SidebarProvider>
|
||||
<div className="flex h-screen w-full">
|
||||
<DashboardSidebar />
|
||||
<SidebarInset>
|
||||
<Outlet />
|
||||
</SidebarInset>
|
||||
</div>
|
||||
<Toaster />
|
||||
<TanStackRouterDevtools />
|
||||
</SidebarProvider>
|
||||
</ConvexProvider>
|
||||
<AuthKitProvider
|
||||
clientId={process.env.BUN_PUBLIC_WORKOS_CLIENT_ID!}
|
||||
redirectUri={process.env.BUN_PUBLIC_WORKOS_REDIRECT_URI!}
|
||||
>
|
||||
<ConvexProviderWithAuthKit
|
||||
client={convexClient}
|
||||
useAuth={useAuth}
|
||||
>
|
||||
<Outlet />
|
||||
</ConvexProviderWithAuthKit>
|
||||
</AuthKitProvider>
|
||||
</QueryClientProvider>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user