Template
- Storefront customer operations in graphql/customer.js and a server-safe services/shopify/customer.ts - Session held in an httpOnly, sameSite=lax cookie set by the /api/account handlers; the access token never reaches client JS - Pages: /account/login, /register, /recover, /reset/[id]/[token] and /activate/[id]/[token] for Shopify's emailed links - /account renders order history as master-detail on one screen, since the Storefront API has no standalone order-by-id query for customers - Header user icon: links to sign-in when signed out, otherwise a menu with name, email, order history, and sign out - Login errors are collapsed and password recovery responds identically for known and unknown emails, so neither form enumerates accounts Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016jWbNNJLksC1QG8z8845FX
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import Header from '@/components/shopify/header';
|
|
import Footer from '@/components/shopify/footer';
|
|
import AccountForm from '@/components/shopify/account-form';
|
|
|
|
export const metadata = { title: 'Activate your account — Shop' };
|
|
|
|
// Shopify's emailed activation link is /account/activate/{id}/{token}.
|
|
export default async function Page({
|
|
params,
|
|
}: {
|
|
params: Promise<{ id: string; token: string }>;
|
|
}) {
|
|
const { id, token } = await params;
|
|
|
|
return (
|
|
<>
|
|
<Header storeName="Shop" logoUrl="" />
|
|
<main className="max-w-screen-2xl mx-auto w-full px-8 py-16">
|
|
<AccountForm
|
|
title="Activate your account"
|
|
description="Choose a password to finish setting up your account."
|
|
fields={[
|
|
{
|
|
name: 'password',
|
|
label: 'Password',
|
|
type: 'password',
|
|
autoComplete: 'new-password',
|
|
},
|
|
]}
|
|
submitLabel="Activate account"
|
|
endpoint="/api/account/activate"
|
|
extraPayload={{ id, activationToken: token }}
|
|
redirectTo="/account"
|
|
/>
|
|
</main>
|
|
<Footer storeName="Shop" copyright="© 2026 Shop. All rights reserved." />
|
|
</>
|
|
);
|
|
}
|