mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
add useAuth context
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { headers } from 'next/headers';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export default async function AuthorizationPage() {
|
||||
const headersList = headers();
|
||||
const access = headersList.get('x-shop-access');
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { LoginMessage } from 'components/auth/login-message';
|
||||
export const runtime = 'edge'; //this needs to be here on thie page. I don't know why
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export default async function LoginPage() {
|
||||
return (
|
||||
|
@@ -4,6 +4,7 @@ import { GeistSans } from 'geist/font/sans';
|
||||
import { ensureStartsWith } from 'lib/utils';
|
||||
import { ReactNode, Suspense } from 'react';
|
||||
import './globals.css';
|
||||
import { AuthProvider } from 'contexts/auth-context';
|
||||
|
||||
const { TWITTER_CREATOR, TWITTER_SITE, SITE_NAME } = process.env;
|
||||
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL
|
||||
@@ -36,13 +37,17 @@ export default async function RootLayout({ children }: { children: ReactNode })
|
||||
return (
|
||||
<html lang="en" className={GeistSans.variable}>
|
||||
<body className="bg-white text-black selection:bg-teal-300 dark:bg-neutral-900 dark:text-white dark:selection:bg-pink-500 dark:selection:text-white">
|
||||
<header>
|
||||
<Banner />
|
||||
<Navbar />
|
||||
</header>
|
||||
<Suspense>
|
||||
<main>{children}</main>
|
||||
</Suspense>
|
||||
<AuthProvider>
|
||||
<div>
|
||||
<header>
|
||||
<Banner />
|
||||
<Navbar />
|
||||
</header>
|
||||
<Suspense>
|
||||
<main>{children}</main>
|
||||
</Suspense>
|
||||
</div>
|
||||
</AuthProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
Reference in New Issue
Block a user