mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Correct the code examples for the Clerk third-party auth docs: - Fix TypeScript error - Change RLS policy check to accept both [Clerk v1 and v2 JWTs](https://clerk.com/docs/backend-requests/resources/session-tokens) Pulled code samples from an example app that I've checked in to make maintenance and testing easier in the future.
56 lines
1.2 KiB
TypeScript
56 lines
1.2 KiB
TypeScript
import type { Metadata } from 'next'
|
|
import {
|
|
ClerkProvider,
|
|
OrganizationSwitcher,
|
|
SignInButton,
|
|
SignUpButton,
|
|
SignedIn,
|
|
SignedOut,
|
|
UserButton,
|
|
} from '@clerk/nextjs'
|
|
import { Geist, Geist_Mono } from 'next/font/google'
|
|
import './globals.css'
|
|
import { InsertData } from '@/components/insert'
|
|
|
|
const geistSans = Geist({
|
|
variable: '--font-geist-sans',
|
|
subsets: ['latin'],
|
|
})
|
|
|
|
const geistMono = Geist_Mono({
|
|
variable: '--font-geist-mono',
|
|
subsets: ['latin'],
|
|
})
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'Clerk Next.js Quickstart',
|
|
description: 'Generated by create next app',
|
|
}
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode
|
|
}>) {
|
|
return (
|
|
<ClerkProvider>
|
|
<html lang="en">
|
|
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
|
|
<header className="flex justify-end items-center p-4 gap-4 h-16">
|
|
<SignedOut>
|
|
<SignInButton />
|
|
<SignUpButton />
|
|
</SignedOut>
|
|
<SignedIn>
|
|
<UserButton />
|
|
<OrganizationSwitcher />
|
|
<InsertData />
|
|
</SignedIn>
|
|
</header>
|
|
{children}
|
|
</body>
|
|
</html>
|
|
</ClerkProvider>
|
|
)
|
|
}
|