create-githat-app 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +4 -3
- package/package.json +6 -2
- package/templates/agent/app/(auth)/forgot-password/page.tsx.hbs +11 -0
- package/templates/agent/app/(auth)/reset-password/page.tsx.hbs +39 -0
- package/templates/agent/app/(auth)/verify-email/page.tsx.hbs +41 -0
- package/templates/agent/app/admin/agent/page.tsx.hbs +159 -62
- package/templates/agent/app/admin/layout.tsx.hbs +82 -0
- package/templates/agent/app/admin/mcp/page.tsx.hbs +156 -0
- package/templates/agent/app/dashboard/agents/page.tsx.hbs +9 -0
- package/templates/agent/app/dashboard/layout.tsx.hbs +9 -0
- package/templates/agent/app/dashboard/mcp/page.tsx.hbs +9 -0
- package/templates/agent/app/dashboard/page.tsx.hbs +128 -0
- package/templates/agent/app/globals.css.hbs +14 -9
- package/templates/agent/app/layout.tsx.hbs +7 -2
- package/templates/agent/app/page.tsx.hbs +127 -70
- package/templates/agent/app/verify/agent/page.tsx.hbs +124 -0
- package/templates/agent/next.config.ts.hbs +4 -5
- package/templates/agent/public/HERO_IMAGE.md +23 -0
- package/templates/base/README.md.hbs +2 -1
- package/templates/base/githat/api/agents.ts.hbs +6 -6
- package/templates/base/githat/auth/guard.tsx.hbs +6 -6
- package/templates/base/githat/config.ts.hbs +7 -9
- package/templates/base/githat/dashboard/layout.tsx.hbs +6 -6
- package/templates/base/githat/dashboard/overview.tsx.hbs +106 -16
- package/templates/classroom/app/layout.tsx.hbs +6 -1
- package/templates/classroom/app/projects/[id]/feedback/feedback-content.tsx.hbs +153 -0
- package/templates/classroom/app/projects/[id]/feedback/page.tsx.hbs +10 -149
- package/templates/classroom/app/projects/[id]/present/page.tsx.hbs +11 -104
- package/templates/classroom/app/projects/[id]/present/presenter-content.tsx.hbs +118 -0
- package/templates/classroom/next.config.ts.hbs +4 -5
- package/templates/content/app/layout.tsx.hbs +6 -1
- package/templates/content/app/posts/[slug]/page.tsx.hbs +10 -86
- package/templates/content/app/posts/[slug]/post-content.tsx.hbs +93 -0
- package/templates/content/next.config.ts.hbs +4 -5
- package/templates/dashboard/app/admin/data/[entity]/page.tsx.hbs +15 -2
- package/templates/dashboard/app/layout.tsx.hbs +6 -1
- package/templates/dashboard/next.config.ts.hbs +4 -5
- package/templates/fullstack/apps-web-nextjs/app/layout.tsx.hbs +6 -1
- package/templates/fullstack/apps-web-nextjs/next.config.ts.hbs +5 -5
- package/templates/marketplace/app/layout.tsx.hbs +6 -1
- package/templates/marketplace/next.config.ts.hbs +4 -5
- package/templates/nextjs/app/(auth)/forgot-password/page.tsx.hbs +2 -54
- package/templates/nextjs/app/(auth)/reset-password/page.tsx.hbs +8 -75
- package/templates/nextjs/app/globals.css.hbs +71 -1
- package/templates/nextjs/app/layout.tsx.hbs +9 -3
- package/templates/nextjs/app/page.tsx.hbs +6 -3
- package/templates/nextjs/next.config.ts.hbs +4 -5
- package/templates/plain/app/layout.tsx.hbs +6 -1
- package/templates/plain/next.config.ts.hbs +4 -5
- package/templates/portfolio/app/layout.tsx.hbs +6 -1
- package/templates/portfolio/next.config.ts.hbs +4 -5
- package/templates/saas/app/layout.tsx.hbs +6 -1
- package/templates/saas/next.config.ts.hbs +4 -5
- package/templates/agent/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/agent/proxy.ts.hbs +0 -10
- package/templates/classroom/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/classroom/proxy.ts.hbs +0 -10
- package/templates/content/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/content/proxy.ts.hbs +0 -10
- package/templates/dashboard/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/dashboard/proxy.ts.hbs +0 -10
- package/templates/fullstack/apps-web-nextjs/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/marketplace/app/(shop)/[slug]/p/[productId]/page.tsx.hbs +0 -99
- package/templates/marketplace/app/(shop)/[slug]/page.tsx.hbs +0 -90
- package/templates/marketplace/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/marketplace/proxy.ts.hbs +0 -10
- package/templates/nextjs/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/nextjs/proxy.ts.hbs +0 -10
- package/templates/plain/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/plain/proxy.ts.hbs +0 -10
- package/templates/portfolio/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/portfolio/proxy.ts.hbs +0 -10
- package/templates/saas/app/api/githat/[...path]/route.ts.hbs +0 -21
- package/templates/saas/proxy.ts.hbs +0 -10
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Product detail — `/<slug>/p/<productId>`.
|
|
3
|
-
*
|
|
4
|
-
* Server component. Fetch by (slug, productId), render. The starter
|
|
5
|
-
* ships sample content so the route works even before a backend
|
|
6
|
-
* exists. Cart writes go through `/api/cart/add` (you build that
|
|
7
|
-
* route handler against your data layer).
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import Link from 'next/link';
|
|
11
|
-
|
|
12
|
-
interface PageProps {
|
|
13
|
-
params: Promise<{ slug: string; productId: string }>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default async function ProductPage({ params }: PageProps) {
|
|
17
|
-
const { slug, productId } = await params;
|
|
18
|
-
|
|
19
|
-
// TODO: replace with a real fetch
|
|
20
|
-
const product = {
|
|
21
|
-
id: productId,
|
|
22
|
-
name: 'Plátanos verdes (libra)',
|
|
23
|
-
price: 0.5,
|
|
24
|
-
description:
|
|
25
|
-
'Plátanos verdes recién llegados, perfectos para mangú. Vendido por libra.',
|
|
26
|
-
fresh: true,
|
|
27
|
-
storeName: 'Colmado de ejemplo',
|
|
28
|
-
storeOwner: 'Don Tito',
|
|
29
|
-
storeSlug: slug,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div style=\{{ background: 'var(--bg)', color: 'var(--fg)', minHeight: 'calc(100vh - 64px)' }}>
|
|
34
|
-
<div style=\{{ maxWidth: '40rem', margin: '0 auto', padding: 'var(--space-8) var(--space-4)' }}>
|
|
35
|
-
<Link href={`/${product.storeSlug}`} style=\{{
|
|
36
|
-
fontSize: '0.875rem',
|
|
37
|
-
color: 'var(--fg-muted)',
|
|
38
|
-
marginBottom: 'var(--space-4)',
|
|
39
|
-
display: 'inline-block',
|
|
40
|
-
}}>
|
|
41
|
-
← {product.storeName}
|
|
42
|
-
</Link>
|
|
43
|
-
|
|
44
|
-
<h1 style=\{{ fontFamily: 'var(--font-wordmark)', fontSize: '2rem', marginBottom: 'var(--space-2)' }}>
|
|
45
|
-
{product.name}
|
|
46
|
-
</h1>
|
|
47
|
-
|
|
48
|
-
{product.fresh && (
|
|
49
|
-
<p style=\{{
|
|
50
|
-
display: 'inline-block',
|
|
51
|
-
padding: 'var(--space-1) var(--space-3)',
|
|
52
|
-
borderRadius: 'var(--radius-full, 9999px)',
|
|
53
|
-
background: 'var(--success)',
|
|
54
|
-
color: 'var(--bg)',
|
|
55
|
-
fontSize: '0.75rem',
|
|
56
|
-
fontWeight: 600,
|
|
57
|
-
marginBottom: 'var(--space-3)',
|
|
58
|
-
}}>
|
|
59
|
-
Está fresquecito
|
|
60
|
-
</p>
|
|
61
|
-
)}
|
|
62
|
-
|
|
63
|
-
<p style=\{{ fontSize: '1.5rem', fontWeight: 600, marginBottom: 'var(--space-4)' }}>
|
|
64
|
-
${product.price.toFixed(2)}
|
|
65
|
-
</p>
|
|
66
|
-
|
|
67
|
-
<p style=\{{ color: 'var(--fg-muted)', marginBottom: 'var(--space-6)', lineHeight: 1.6 }}>
|
|
68
|
-
{product.description}
|
|
69
|
-
</p>
|
|
70
|
-
|
|
71
|
-
<p style=\{{ fontSize: '0.875rem', color: 'var(--fg-subtle)', marginBottom: 'var(--space-6)' }}>
|
|
72
|
-
De tu colmadero: <strong>{product.storeOwner}</strong>
|
|
73
|
-
</p>
|
|
74
|
-
|
|
75
|
-
{/*
|
|
76
|
-
Cart-add is a real fetch in production — you wire it to
|
|
77
|
-
/api/cart/add against your data layer + the anon-session
|
|
78
|
-
cookie from src/lib/anon-session.ts.
|
|
79
|
-
*/}
|
|
80
|
-
<form action="/api/cart/add" method="POST">
|
|
81
|
-
<input type="hidden" name="productId" value={product.id} />
|
|
82
|
-
<input type="hidden" name="slug" value={product.storeSlug} />
|
|
83
|
-
<button type="submit" style=\{{
|
|
84
|
-
padding: 'var(--space-3) var(--space-6)',
|
|
85
|
-
borderRadius: 'var(--radius-md, 0.5rem)',
|
|
86
|
-
border: 'none',
|
|
87
|
-
background: 'var(--primary)',
|
|
88
|
-
color: 'var(--bg)',
|
|
89
|
-
fontWeight: 600,
|
|
90
|
-
fontSize: '1rem',
|
|
91
|
-
cursor: 'pointer',
|
|
92
|
-
}}>
|
|
93
|
-
Echar a la funda — Add to bag
|
|
94
|
-
</button>
|
|
95
|
-
</form>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A single colmadero's storefront — `/<slug>`.
|
|
3
|
-
*
|
|
4
|
-
* Server component. Take the slug, fetch the colmado's profile +
|
|
5
|
-
* products from your data layer, render. The starter ships static
|
|
6
|
-
* sample content so the route renders even without a backend.
|
|
7
|
-
*
|
|
8
|
-
* Real implementations:
|
|
9
|
-
* - Read by slug from your `colmados` table (Postgres, DynamoDB,
|
|
10
|
-
* whatever)
|
|
11
|
-
* - 404 via `notFound()` from 'next/navigation' if the slug is
|
|
12
|
-
* unknown
|
|
13
|
-
* - Pre-render the popular ones via `generateStaticParams()`
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import Link from 'next/link';
|
|
17
|
-
|
|
18
|
-
interface PageProps {
|
|
19
|
-
params: Promise<{ slug: string }>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default async function ShopPage({ params }: PageProps) {
|
|
23
|
-
const { slug } = await params;
|
|
24
|
-
|
|
25
|
-
// TODO: replace with a real fetch
|
|
26
|
-
const colmado = {
|
|
27
|
-
name: 'Colmado de ejemplo',
|
|
28
|
-
slug,
|
|
29
|
-
owner: 'Don Tito',
|
|
30
|
-
address: 'Calle Duarte #42',
|
|
31
|
-
open: true,
|
|
32
|
-
products: [
|
|
33
|
-
{ id: '1', name: 'Plátanos verdes (libra)', price: 0.5, fresh: true },
|
|
34
|
-
{ id: '2', name: 'Café Santo Domingo (1lb)', price: 6.99, fresh: false },
|
|
35
|
-
{ id: '3', name: 'Salami Induveca', price: 4.5, fresh: false },
|
|
36
|
-
{ id: '4', name: 'Recarga Claro $5', price: 5.0, fresh: false },
|
|
37
|
-
],
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<div style=\{{ background: 'var(--bg)', color: 'var(--fg)', minHeight: 'calc(100vh - 64px)' }}>
|
|
42
|
-
<div style=\{{ maxWidth: '48rem', margin: '0 auto', padding: 'var(--space-8) var(--space-4)' }}>
|
|
43
|
-
<header style=\{{ marginBottom: 'var(--space-8)' }}>
|
|
44
|
-
<h1 style=\{{ fontFamily: 'var(--font-wordmark)', fontSize: '2.25rem', marginBottom: 'var(--space-2)' }}>
|
|
45
|
-
{colmado.name}
|
|
46
|
-
</h1>
|
|
47
|
-
<p style=\{{ color: 'var(--fg-muted)', marginBottom: 'var(--space-2)' }}>
|
|
48
|
-
Tu colmadero: <strong>{colmado.owner}</strong>
|
|
49
|
-
</p>
|
|
50
|
-
<p style=\{{ color: 'var(--fg-subtle)', fontSize: '0.875rem', display: 'flex', gap: 'var(--space-3)', alignItems: 'center' }}>
|
|
51
|
-
<span>{colmado.address}</span>
|
|
52
|
-
<span>·</span>
|
|
53
|
-
<span style=\{{ color: colmado.open ? 'var(--success)' : 'var(--danger)' }}>
|
|
54
|
-
{colmado.open ? 'Abierto ahorita' : 'Cerrado'}
|
|
55
|
-
</span>
|
|
56
|
-
</p>
|
|
57
|
-
</header>
|
|
58
|
-
|
|
59
|
-
<section>
|
|
60
|
-
<h2 style=\{{ fontSize: '1.5rem', marginBottom: 'var(--space-4)' }}>Productos</h2>
|
|
61
|
-
<ul style=\{{ listStyle: 'none', display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))', gap: 'var(--space-3)' }}>
|
|
62
|
-
{colmado.products.map((p) => (
|
|
63
|
-
<li key={p.id}>
|
|
64
|
-
<Link href={`/${slug}/p/${p.id}`} style=\{{
|
|
65
|
-
display: 'block',
|
|
66
|
-
padding: 'var(--space-4)',
|
|
67
|
-
borderRadius: 'var(--radius-md, 0.5rem)',
|
|
68
|
-
border: '1px solid var(--border)',
|
|
69
|
-
background: 'var(--surface)',
|
|
70
|
-
color: 'inherit',
|
|
71
|
-
textDecoration: 'none',
|
|
72
|
-
}}>
|
|
73
|
-
<div style=\{{ fontWeight: 600, marginBottom: 'var(--space-1)' }}>{p.name}</div>
|
|
74
|
-
{p.fresh && (
|
|
75
|
-
<div style=\{{ fontSize: '0.75rem', color: 'var(--success)', marginBottom: 'var(--space-1)' }}>
|
|
76
|
-
Está fresquecito
|
|
77
|
-
</div>
|
|
78
|
-
)}
|
|
79
|
-
<div style=\{{ fontSize: '0.875rem', color: 'var(--fg-muted)' }}>
|
|
80
|
-
${p.price.toFixed(2)}
|
|
81
|
-
</div>
|
|
82
|
-
</Link>
|
|
83
|
-
</li>
|
|
84
|
-
))}
|
|
85
|
-
</ul>
|
|
86
|
-
</section>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Same-origin GitHat API proxy.
|
|
3
|
-
*
|
|
4
|
-
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
-
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
-
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
-
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
-
*
|
|
9
|
-
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
-
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
-
* on this app's domain.
|
|
12
|
-
*
|
|
13
|
-
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
-
*/
|
|
15
|
-
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
-
|
|
17
|
-
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
-
|
|
19
|
-
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
-
export const dynamic = "force-dynamic";
|
|
21
|
-
export const revalidate = 0;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { authProxy } from '@githat/nextjs/proxy';
|
|
2
|
-
|
|
3
|
-
export const proxy = authProxy({
|
|
4
|
-
publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
|
|
5
|
-
signInUrl: '/sign-in',
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const config = {
|
|
9
|
-
matcher: ['/((?!_next|api|.*\\..*).*)'],
|
|
10
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Same-origin GitHat API proxy.
|
|
3
|
-
*
|
|
4
|
-
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
-
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
-
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
-
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
-
*
|
|
9
|
-
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
-
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
-
* on this app's domain.
|
|
12
|
-
*
|
|
13
|
-
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
-
*/
|
|
15
|
-
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
-
|
|
17
|
-
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
-
|
|
19
|
-
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
-
export const dynamic = "force-dynamic";
|
|
21
|
-
export const revalidate = 0;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { authProxy } from '@githat/nextjs/proxy';
|
|
2
|
-
|
|
3
|
-
export const proxy = authProxy({
|
|
4
|
-
publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
|
|
5
|
-
signInUrl: '/sign-in',
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const config = {
|
|
9
|
-
matcher: ['/((?!_next|api|.*\\..*).*)'],
|
|
10
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Same-origin GitHat API proxy.
|
|
3
|
-
*
|
|
4
|
-
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
-
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
-
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
-
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
-
*
|
|
9
|
-
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
-
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
-
* on this app's domain.
|
|
12
|
-
*
|
|
13
|
-
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
-
*/
|
|
15
|
-
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
-
|
|
17
|
-
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
-
|
|
19
|
-
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
-
export const dynamic = "force-dynamic";
|
|
21
|
-
export const revalidate = 0;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { authProxy } from '@githat/nextjs/proxy';
|
|
2
|
-
|
|
3
|
-
export const proxy = authProxy({
|
|
4
|
-
publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
|
|
5
|
-
signInUrl: '/sign-in',
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const config = {
|
|
9
|
-
matcher: ['/((?!_next|api|.*\\..*).*)'],
|
|
10
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Same-origin GitHat API proxy.
|
|
3
|
-
*
|
|
4
|
-
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
-
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
-
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
-
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
-
*
|
|
9
|
-
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
-
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
-
* on this app's domain.
|
|
12
|
-
*
|
|
13
|
-
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
-
*/
|
|
15
|
-
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
-
|
|
17
|
-
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
-
|
|
19
|
-
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
-
export const dynamic = "force-dynamic";
|
|
21
|
-
export const revalidate = 0;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { authProxy } from '@githat/nextjs/proxy';
|
|
2
|
-
|
|
3
|
-
export const proxy = authProxy({
|
|
4
|
-
publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
|
|
5
|
-
signInUrl: '/sign-in',
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const config = {
|
|
9
|
-
matcher: ['/((?!_next|api|.*\\..*).*)'],
|
|
10
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Same-origin GitHat API proxy.
|
|
3
|
-
*
|
|
4
|
-
* Forwards every request to api.githat.io and re-emits upstream Set-Cookie
|
|
5
|
-
* headers on this app's domain. Without this bridge, the auth cookie set
|
|
6
|
-
* by api.githat.io is invisible to the consumer's proxy.ts and getAuth(),
|
|
7
|
-
* which produces a sign-in → app-page → "session expired" loop.
|
|
8
|
-
*
|
|
9
|
-
* The SDK is wired to this URL via `apiUrl: "/api/githat"` on
|
|
10
|
-
* GitHatProvider, so every fetch becomes same-origin and cookies land
|
|
11
|
-
* on this app's domain.
|
|
12
|
-
*
|
|
13
|
-
* Implementation lives in @githat/nextjs/server.githatApiProxy().
|
|
14
|
-
*/
|
|
15
|
-
import { githatApiProxy } from "@githat/nextjs/server";
|
|
16
|
-
|
|
17
|
-
export const { GET, POST, PUT, PATCH, DELETE, OPTIONS } = githatApiProxy();
|
|
18
|
-
|
|
19
|
-
// Auth flows are stateful — never cache the proxied responses.
|
|
20
|
-
export const dynamic = "force-dynamic";
|
|
21
|
-
export const revalidate = 0;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { authProxy } from '@githat/nextjs/proxy';
|
|
2
|
-
|
|
3
|
-
export const proxy = authProxy({
|
|
4
|
-
publicRoutes: ['/', '/sign-in', '/sign-up'{{#if includeForgotPassword}}, '/forgot-password', '/reset-password'{{/if}}{{#if includeEmailVerification}}, '/verify-email'{{/if}}],
|
|
5
|
-
signInUrl: '/sign-in',
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const config = {
|
|
9
|
-
matcher: ['/((?!_next|api|.*\\..*).*)'],
|
|
10
|
-
};
|