stackpatch 1.1.2 β 1.1.5
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/README.md +182 -170
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,76 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h2 align="center">
|
|
3
|
+
StackPatch β‘
|
|
4
|
+
</h2>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
Composable frontend features for modern React & Next.js apps
|
|
8
|
+
<br />
|
|
9
|
+
Add production-ready features to existing projects without restructuring
|
|
10
|
+
<br />
|
|
11
|
+
<a href="https://stackpatch.darshitdev.in"><strong>Visit Website Β»</strong></a>
|
|
12
|
+
<br />
|
|
13
|
+
<br />
|
|
14
|
+
<a href="https://github.com/Darshh09/StackPatch/issues">Issues</a>
|
|
15
|
+
Β·
|
|
16
|
+
<a href="https://github.com/Darshh09/StackPatch">GitHub</a>
|
|
17
|
+
Β·
|
|
18
|
+
<a href="https://www.producthunt.com/products/stackpatch">Product Hunt</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="https://www.producthunt.com/products/stackpatch?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-stackpatch" target="_blank" rel="noopener noreferrer">
|
|
23
|
+
<img alt="StackPatch - Patch authentication into your Next.js app with one command | Product Hunt" width="250" height="54" src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1063012&theme=light&t=1768419170786" />
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
[](https://npm.chart.dev/stackpatch?primary=neutral&gray=neutral&theme=dark)
|
|
28
|
+
[](https://www.npmjs.com/package/stackpatch)
|
|
29
|
+
[](https://github.com/Darshh09/StackPatch/stargazers)
|
|
30
|
+
[](https://www.producthunt.com/products/stackpatch)
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
## About the Project
|
|
34
|
+
|
|
35
|
+
StackPatch is a CLI tool that helps you quickly add production-ready features to your Next.js applications. No more copy-pasting boilerplate code or configuring complex setupsβjust run a command and you're done.
|
|
36
|
+
|
|
37
|
+
Think of StackPatch as **shadcn/ui, but for complete features** instead of components. Each patch is self-contained, fully reversible, and designed to work with your existing project structure.
|
|
38
|
+
|
|
39
|
+
### Why StackPatch
|
|
40
|
+
|
|
41
|
+
Adding features to existing Next.js projects often means:
|
|
42
|
+
- Copy-pasting boilerplate code from multiple sources
|
|
43
|
+
- Manually configuring complex setups
|
|
44
|
+
- Worrying about breaking existing code
|
|
45
|
+
- Struggling with path aliases and directory structures
|
|
46
|
+
|
|
47
|
+
StackPatch solves this by:
|
|
48
|
+
- β
**Zero Configuration** - Interactive setup guides you through everything
|
|
49
|
+
- β
**Smart Detection** - Automatically adapts to your project structure (`app/` vs `src/app/`)
|
|
50
|
+
- β
**Fully Reversible** - Track and revert any installation safely
|
|
51
|
+
- β
**Own Your Code** - Every line of code is yours to modify
|
|
52
|
+
- β
**Production-Ready** - Battle-tested patterns, not toy examples
|
|
29
53
|
|
|
30
54
|
## π Quick Start
|
|
31
55
|
|
|
32
|
-
###
|
|
56
|
+
### Add to Existing Project
|
|
57
|
+
|
|
58
|
+
Navigate to your Next.js project directory and run:
|
|
33
59
|
|
|
34
60
|
```bash
|
|
35
|
-
|
|
36
|
-
# or
|
|
37
|
-
bun add -g stackpatch
|
|
61
|
+
npx stackpatch add auth
|
|
38
62
|
```
|
|
39
63
|
|
|
40
|
-
|
|
64
|
+
The CLI will guide you through an interactive setup:
|
|
65
|
+
1. **Session Mode** - Choose Database (persistent) or Stateless (JWT)
|
|
66
|
+
2. **Database** (if database mode) - Select PostgreSQL, MySQL, SQLite, or MongoDB
|
|
67
|
+
3. **ORM** (if database mode) - Choose Drizzle, Prisma, or Raw SQL
|
|
68
|
+
4. **Auth Providers** - Enable Email/Password and select OAuth (Google, GitHub)
|
|
69
|
+
5. **UI Components** - Choose whether to add prebuilt login/signup pages
|
|
70
|
+
6. **Protected Routes** - Select which routes to protect (supports wildcards like `/dashboard/*`)
|
|
71
|
+
|
|
72
|
+
### Create New Project
|
|
41
73
|
|
|
42
74
|
```bash
|
|
43
|
-
# Using npm create (recommended
|
|
75
|
+
# Using npm create (recommended)
|
|
44
76
|
npm create stackpatch@latest my-app
|
|
45
77
|
|
|
46
|
-
# Using npx
|
|
78
|
+
# Using npx
|
|
47
79
|
npx create-stackpatch@latest my-app
|
|
48
80
|
# or
|
|
49
81
|
npx stackpatch create my-app
|
|
50
82
|
|
|
51
83
|
# Using bunx (Bun's npx equivalent)
|
|
52
84
|
bunx create-stackpatch@latest my-app
|
|
53
|
-
# or
|
|
54
|
-
bunx stackpatch create my-app
|
|
55
85
|
```
|
|
56
86
|
|
|
57
|
-
> **Note:**
|
|
58
|
-
> - `bun create stackpatch@latest` won't work because Bun's `create` command looks for packages named `create-*` in npm. Use `bunx` instead.
|
|
59
|
-
> - `npm create stackpatch` works because it uses the `create-stackpatch` binary from the `stackpatch` package.
|
|
60
|
-
> - All commands will prompt you for a project name if not provided.
|
|
61
|
-
|
|
62
|
-
### Add Features to Existing Project
|
|
63
|
-
|
|
64
|
-
Navigate to your Next.js project directory and run:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
# Add authentication with UI
|
|
68
|
-
npx stackpatch add auth
|
|
69
|
-
# or
|
|
70
|
-
npx stackpatch add auth-ui
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
> **Note:** Both `auth` and `auth-ui` commands are identical - they add the complete authentication setup.
|
|
87
|
+
> **Note:** All commands will prompt you for a project name if not provided.
|
|
74
88
|
|
|
75
89
|
### Revert an Installation
|
|
76
90
|
|
|
@@ -91,29 +105,27 @@ This will:
|
|
|
91
105
|
|
|
92
106
|
### Authentication Setup
|
|
93
107
|
|
|
94
|
-
When you run `npx stackpatch add auth`, StackPatch:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
4. **Tracks all changes** in `.stackpatch/manifest.json` for safe reversion
|
|
108
|
+
When you run `npx stackpatch add auth`, StackPatch automatically generates:
|
|
109
|
+
|
|
110
|
+
- β
**Better Auth configuration** (`lib/auth.ts` or `src/lib/auth.ts`)
|
|
111
|
+
- β
**Auth client utilities** (`lib/auth-client.ts` or `src/lib/auth-client.ts`)
|
|
112
|
+
- β
**Protected routes config** (`lib/protected-routes.ts` - only if protected routes are configured)
|
|
113
|
+
- β
**API route handler** (`app/api/auth/[...all]/route.ts`)
|
|
114
|
+
- β
**Middleware** (`middleware.ts` - only if protected routes are configured)
|
|
115
|
+
- β
**Login/Signup pages** (`app/auth/login/page.tsx`, `app/auth/signup/page.tsx` - if UI enabled)
|
|
116
|
+
- β
**Landing page** (`app/stackpatch/page.tsx` - if UI enabled)
|
|
117
|
+
- β
**Auth wrapper** (`components/auth-wrapper.tsx` - if UI enabled, added to layout.tsx)
|
|
118
|
+
- β
**Toaster component** (`components/toaster.tsx` - if UI enabled, added to layout.tsx)
|
|
119
|
+
- β
**Environment template** (`.env.example`)
|
|
120
|
+
|
|
121
|
+
### Smart File Placement
|
|
122
|
+
|
|
123
|
+
StackPatch automatically:
|
|
124
|
+
- β
Detects if your app is in `app/` or `src/app/`
|
|
125
|
+
- β
Places components in matching location (`components/` or `src/components/`)
|
|
126
|
+
- β
Uses your `tsconfig.json` path aliases for imports
|
|
127
|
+
- β
Generates correct import paths automatically
|
|
128
|
+
- β
Tracks all changes in `.stackpatch/manifest.json` for safe reversion
|
|
117
129
|
|
|
118
130
|
## π OAuth Setup
|
|
119
131
|
|
|
@@ -126,7 +138,7 @@ If you selected Google OAuth:
|
|
|
126
138
|
1. Go to [Google Cloud Console](https://console.cloud.google.com/)
|
|
127
139
|
2. Create a project β APIs & Services β Credentials
|
|
128
140
|
3. Create OAuth client ID (Web application)
|
|
129
|
-
4. Add redirect URI: `http://localhost:3000/api/auth/callback/google`
|
|
141
|
+
4. Add redirect URI: `http://localhost:3000/api/auth/callback/google` (or your production URL)
|
|
130
142
|
5. Copy Client ID and Secret to `.env.local`:
|
|
131
143
|
```env
|
|
132
144
|
GOOGLE_CLIENT_ID=your_client_id
|
|
@@ -139,7 +151,7 @@ If you selected GitHub OAuth:
|
|
|
139
151
|
|
|
140
152
|
1. Go to [GitHub Developer Settings](https://github.com/settings/developers)
|
|
141
153
|
2. New OAuth App
|
|
142
|
-
3. Set callback URL: `http://localhost:3000/api/auth/callback/github`
|
|
154
|
+
3. Set callback URL: `http://localhost:3000/api/auth/callback/github` (or your production URL)
|
|
143
155
|
4. Copy Client ID and generate Secret
|
|
144
156
|
5. Add to `.env.local`:
|
|
145
157
|
```env
|
|
@@ -152,8 +164,8 @@ If you selected GitHub OAuth:
|
|
|
152
164
|
Your `.env.local` will include only the variables for providers you selected:
|
|
153
165
|
|
|
154
166
|
```env
|
|
155
|
-
|
|
156
|
-
|
|
167
|
+
BETTER_AUTH_SECRET=your_generated_secret
|
|
168
|
+
BETTER_AUTH_URL=http://localhost:3000
|
|
157
169
|
|
|
158
170
|
# Only included if you selected Google
|
|
159
171
|
GOOGLE_CLIENT_ID=your_google_client_id
|
|
@@ -164,85 +176,76 @@ GITHUB_CLIENT_ID=your_github_client_id
|
|
|
164
176
|
GITHUB_CLIENT_SECRET=your_github_client_secret
|
|
165
177
|
```
|
|
166
178
|
|
|
167
|
-
##
|
|
179
|
+
## π‘οΈ Protecting Routes
|
|
168
180
|
|
|
169
|
-
|
|
170
|
-
- **
|
|
171
|
-
- **
|
|
181
|
+
StackPatch automatically protects routes based on your configuration. Routes are protected via:
|
|
182
|
+
- **Middleware** - Server-side protection with automatic redirects
|
|
183
|
+
- **AuthWrapper** - Client-side protection in your root layout
|
|
172
184
|
|
|
173
|
-
|
|
185
|
+
### How It Works
|
|
174
186
|
|
|
175
|
-
|
|
187
|
+
1. **During Setup**: You'll be prompted to select which routes to protect
|
|
188
|
+
2. **Automatic Protection**: StackPatch configures middleware and AuthWrapper automatically
|
|
189
|
+
3. **Redirects**: Unauthenticated users are redirected to `/auth/login?redirect=<original-path>`
|
|
190
|
+
4. **After Login**: Users are automatically redirected back to the original protected route
|
|
176
191
|
|
|
177
|
-
|
|
178
|
-
// app/layout.tsx or any page
|
|
179
|
-
import { AuthNavbar } from "@/components/auth-navbar";
|
|
180
|
-
|
|
181
|
-
export default function Layout({ children }) {
|
|
182
|
-
return (
|
|
183
|
-
<>
|
|
184
|
-
<AuthNavbar />
|
|
185
|
-
{children}
|
|
186
|
-
</>
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
```
|
|
192
|
+
### Wildcard Routes
|
|
190
193
|
|
|
191
|
-
|
|
194
|
+
Use `/*` to protect a route and all its sub-routes:
|
|
192
195
|
|
|
193
|
-
|
|
196
|
+
- `/dashboard` β Protects only `/dashboard`
|
|
197
|
+
- `/dashboard/*` β Protects `/dashboard` and ALL sub-routes (`/dashboard/settings`, `/dashboard/users`, etc.)
|
|
194
198
|
|
|
195
|
-
|
|
199
|
+
**Examples:**
|
|
200
|
+
```
|
|
201
|
+
/dashboard/* β Protects /dashboard and all sub-routes
|
|
202
|
+
/admin/* β Protects /admin and all sub-routes
|
|
203
|
+
/profile β Protects only /profile (not sub-routes)
|
|
204
|
+
```
|
|
196
205
|
|
|
197
|
-
|
|
206
|
+
**To Modify Protected Routes:**
|
|
207
|
+
Edit `lib/protected-routes.ts` (or `src/lib/protected-routes.ts`):
|
|
198
208
|
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return (
|
|
206
|
-
<ProtectedRoute>
|
|
207
|
-
<AuthNavbar />
|
|
208
|
-
<h1>Protected Dashboard</h1>
|
|
209
|
-
</ProtectedRoute>
|
|
210
|
-
);
|
|
211
|
-
}
|
|
209
|
+
```ts
|
|
210
|
+
export const PROTECTED_ROUTES = [
|
|
211
|
+
"/dashboard/*", // Protects /dashboard and all sub-routes
|
|
212
|
+
"/admin/*", // Protects /admin and all sub-routes
|
|
213
|
+
"/profile", // Protects only /profile
|
|
214
|
+
] as const;
|
|
212
215
|
```
|
|
213
216
|
|
|
214
|
-
|
|
217
|
+
## βοΈ Configuration Options
|
|
215
218
|
|
|
216
|
-
|
|
219
|
+
### Session Modes
|
|
217
220
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"/profile/:path*", // Protect all profile routes
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
|
-
```
|
|
221
|
+
**Database Mode** (Recommended for production):
|
|
222
|
+
- Persistent sessions stored in your database
|
|
223
|
+
- Supports session management and revocation
|
|
224
|
+
- Requires database setup (PostgreSQL, MySQL, SQLite, or MongoDB)
|
|
225
|
+
- Choose an ORM: Drizzle, Prisma, or Raw SQL
|
|
227
226
|
|
|
228
|
-
|
|
227
|
+
**Stateless Mode** (JWT/JWE):
|
|
228
|
+
- No database required
|
|
229
|
+
- Sessions stored in encrypted cookies
|
|
230
|
+
- Perfect for serverless deployments
|
|
231
|
+
- Limited session management features
|
|
229
232
|
|
|
230
|
-
|
|
233
|
+
### Email/Password Authentication
|
|
231
234
|
|
|
232
|
-
|
|
235
|
+
Email/password authentication works out of the box with Better Auth. If you selected database mode:
|
|
233
236
|
|
|
234
|
-
|
|
237
|
+
1. **Generate database schema**:
|
|
238
|
+
```bash
|
|
239
|
+
npx @better-auth/cli generate
|
|
240
|
+
# or
|
|
241
|
+
npx @better-auth/cli migrate
|
|
242
|
+
```
|
|
235
243
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
- Replace the `authorize` function with database lookup
|
|
240
|
-
- Hash and compare passwords using bcrypt
|
|
241
|
-
4. **Create signup API** (`app/api/auth/signup/route.ts`):
|
|
242
|
-
- Hash passwords before storing
|
|
243
|
-
- Validate and create users in database
|
|
244
|
+
2. **Configure in `lib/auth.ts`** (already set up by StackPatch):
|
|
245
|
+
- Database adapter is configured based on your selection
|
|
246
|
+
- Email/password is enabled if you selected it
|
|
244
247
|
|
|
245
|
-
See
|
|
248
|
+
See Better Auth documentation for advanced configuration: https://better-auth.dev/docs
|
|
246
249
|
|
|
247
250
|
## π File Locations
|
|
248
251
|
|
|
@@ -250,16 +253,20 @@ After running `npx stackpatch add auth`, you'll find files in locations that mat
|
|
|
250
253
|
|
|
251
254
|
### If your app is in `app/`:
|
|
252
255
|
- **Auth pages**: `app/auth/login/page.tsx`, `app/auth/signup/page.tsx`
|
|
253
|
-
- **
|
|
254
|
-
- **
|
|
256
|
+
- **Auth config**: `lib/auth.ts`, `lib/auth-client.ts`
|
|
257
|
+
- **Protected routes config**: `lib/protected-routes.ts`
|
|
258
|
+
- **API routes**: `app/api/auth/[...all]/route.ts`
|
|
259
|
+
- **Components**: `components/auth-wrapper.tsx`, `components/toaster.tsx`
|
|
255
260
|
- **Middleware**: `middleware.ts` (root)
|
|
256
261
|
- **Environment**: `.env.example`, `.env.local`
|
|
257
262
|
- **Tracking**: `.stackpatch/manifest.json` (for revert)
|
|
258
263
|
|
|
259
264
|
### If your app is in `src/app/`:
|
|
260
265
|
- **Auth pages**: `src/app/auth/login/page.tsx`, `src/app/auth/signup/page.tsx`
|
|
261
|
-
- **
|
|
262
|
-
- **
|
|
266
|
+
- **Auth config**: `src/lib/auth.ts`, `src/lib/auth-client.ts`
|
|
267
|
+
- **Protected routes config**: `src/lib/protected-routes.ts`
|
|
268
|
+
- **API routes**: `src/app/api/auth/[...all]/route.ts`
|
|
269
|
+
- **Components**: `src/components/auth-wrapper.tsx`, `src/components/toaster.tsx`
|
|
263
270
|
- **Middleware**: `middleware.ts` (root)
|
|
264
271
|
- **Environment**: `.env.example`, `.env.local`
|
|
265
272
|
- **Tracking**: `.stackpatch/manifest.json` (for revert)
|
|
@@ -271,36 +278,35 @@ StackPatch automatically detects your project structure and places files accordi
|
|
|
271
278
|
|
|
272
279
|
## π§ Customization
|
|
273
280
|
|
|
274
|
-
### Change
|
|
281
|
+
### Change Default Redirect After Login
|
|
275
282
|
|
|
276
|
-
|
|
283
|
+
The login/signup pages automatically redirect users based on:
|
|
284
|
+
1. The `redirect` query parameter (set by middleware when protecting routes)
|
|
285
|
+
2. Fallback to `/stackpatch` if no redirect parameter
|
|
277
286
|
|
|
278
|
-
|
|
279
|
-
pages: {
|
|
280
|
-
signIn: "/your-custom-login", // Change this
|
|
281
|
-
}
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### Custom Protected Route Redirect
|
|
287
|
+
To change the fallback route, edit `app/auth/login/page.tsx` and `app/auth/signup/page.tsx`:
|
|
285
288
|
|
|
286
289
|
```tsx
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
</ProtectedRoute>
|
|
290
|
+
// Change the fallback route (default: "/stackpatch")
|
|
291
|
+
const redirectTo = searchParams.get("redirect") || "/your-custom-route";
|
|
290
292
|
```
|
|
291
293
|
|
|
292
294
|
### Protect API Routes
|
|
293
295
|
|
|
294
296
|
```ts
|
|
295
297
|
// app/api/protected/route.ts
|
|
296
|
-
import {
|
|
297
|
-
import {
|
|
298
|
+
import { auth } from "@/lib/auth";
|
|
299
|
+
import { headers } from "next/headers";
|
|
298
300
|
|
|
299
301
|
export async function GET() {
|
|
300
|
-
const session = await
|
|
301
|
-
|
|
302
|
+
const session = await auth.api.getSession({
|
|
303
|
+
headers: await headers(),
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
if (!session || !session.user) {
|
|
302
307
|
return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
303
308
|
}
|
|
309
|
+
|
|
304
310
|
return Response.json({ data: "Protected data" });
|
|
305
311
|
}
|
|
306
312
|
```
|
|
@@ -310,7 +316,7 @@ export async function GET() {
|
|
|
310
316
|
### OAuth redirect_uri_mismatch
|
|
311
317
|
|
|
312
318
|
- Ensure redirect URIs match exactly in OAuth provider settings
|
|
313
|
-
- Check `
|
|
319
|
+
- Check `BETTER_AUTH_URL` matches your app URL (defaults to `http://localhost:3000` in development)
|
|
314
320
|
|
|
315
321
|
### OAuth buttons not working
|
|
316
322
|
|
|
@@ -346,11 +352,14 @@ your-project/
|
|
|
346
352
|
β β βββ signup/page.tsx # Signup page
|
|
347
353
|
β βββ api/
|
|
348
354
|
β βββ auth/
|
|
349
|
-
β βββ [...
|
|
355
|
+
β βββ [...all]/route.ts # Better Auth API route
|
|
356
|
+
βββ lib/
|
|
357
|
+
β βββ auth.ts # Better Auth configuration
|
|
358
|
+
β βββ auth-client.ts # Client-side auth utilities
|
|
359
|
+
β βββ protected-routes.ts # Protected routes configuration
|
|
350
360
|
βββ components/
|
|
351
|
-
β βββ
|
|
352
|
-
β
|
|
353
|
-
β βββ session-provider.tsx # Session provider
|
|
361
|
+
β βββ auth-wrapper.tsx # Automatic route protection wrapper
|
|
362
|
+
β βββ toaster.tsx # Toast notifications
|
|
354
363
|
βββ middleware.ts # Route protection middleware
|
|
355
364
|
βββ .env.local # Your environment variables
|
|
356
365
|
βββ .stackpatch/ # Tracking for revert (git-ignored)
|
|
@@ -369,11 +378,14 @@ your-project/
|
|
|
369
378
|
β β β βββ signup/page.tsx
|
|
370
379
|
β β βββ api/
|
|
371
380
|
β β βββ auth/
|
|
372
|
-
β β βββ [...
|
|
381
|
+
β β βββ [...all]/route.ts
|
|
382
|
+
β βββ lib/
|
|
383
|
+
β β βββ auth.ts
|
|
384
|
+
β β βββ auth-client.ts
|
|
385
|
+
β β βββ protected-routes.ts
|
|
373
386
|
β βββ components/
|
|
374
|
-
β βββ
|
|
375
|
-
β
|
|
376
|
-
β βββ session-provider.tsx
|
|
387
|
+
β βββ auth-wrapper.tsx
|
|
388
|
+
β βββ toaster.tsx
|
|
377
389
|
βββ middleware.ts
|
|
378
390
|
βββ .env.local
|
|
379
391
|
βββ .stackpatch/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stackpatch",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Composable frontend features for modern React & Next.js apps - Add authentication, UI components, and more with zero configuration",
|
|
5
5
|
"main": "bin/stackpatch.ts",
|
|
6
6
|
"type": "module",
|