-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.ts
More file actions
39 lines (37 loc) · 1.09 KB
/
proxy.ts
File metadata and controls
39 lines (37 loc) · 1.09 KB
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
29
30
31
32
33
34
35
36
37
38
39
import { authkitMiddleware } from '@workos-inc/authkit-nextjs';
export default authkitMiddleware({
eagerAuth: true,
middlewareAuth: {
enabled: true,
unauthenticatedPaths: [
'/',
'/sign-in',
'/sign-up',
'/blog',
'/blog/:path*',
'/about',
'/contact',
'/privacy',
'/licence',
'/pricing',
// Public profile pages: any top-level /:username route
'/:username',
// Dynamic OG image generation for social sharing previews
'/api/og/:username',
],
},
redirectUri:
process.env.VERCEL_ENV === 'preview'
? `https://${process.env.VERCEL_BRANCH_URL}/callback`
: process.env.VERCEL_ENV === 'production'
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}/callback`
: undefined,
});
export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
};