import { redirect } from 'next/navigation'; import Header from '@/components/shopify/header'; import Footer from '@/components/shopify/footer'; import OrderHistory from '@/components/shopify/order-history'; import { getSessionToken } from '@/services/shopify/session'; import { getCustomer } from '@/services/shopify/customer'; export const metadata = { title: 'Order history — Shop' }; export default async function Page() { const token = await getSessionToken(); if (!token) redirect('/account/login'); const customer = await getCustomer(token, 20); // An expired or revoked token reads as signed out. if (!customer) redirect('/account/login'); return ( <> Order history {customer.displayName} · {customer.email} > ); }
{customer.displayName} · {customer.email}