@solvapay/auth 1.0.1-preview.1 → 1.0.1-preview.2
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 +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,14 +213,16 @@ Both adapters and Next.js utilities work in Edge runtimes (Vercel Edge Functions
|
|
|
213
213
|
|
|
214
214
|
## Next.js Integration
|
|
215
215
|
|
|
216
|
-
These utilities work seamlessly with Next.js middleware.
|
|
216
|
+
These utilities work seamlessly with Next.js authentication middleware.
|
|
217
|
+
In Next.js 16, this middleware lives in `proxy.ts` and typically sets the
|
|
218
|
+
`x-user-id` header after authentication:
|
|
217
219
|
|
|
218
220
|
```ts
|
|
219
|
-
//
|
|
221
|
+
// proxy.ts
|
|
220
222
|
import { NextResponse } from 'next/server'
|
|
221
223
|
import type { NextRequest } from 'next/server'
|
|
222
224
|
|
|
223
|
-
export async function
|
|
225
|
+
export async function proxy(request: NextRequest) {
|
|
224
226
|
// Extract user ID from your auth system (Supabase, Auth0, etc.)
|
|
225
227
|
const userId = await getUserIdFromAuth(request)
|
|
226
228
|
|