Skip to content

Commit

Permalink
chore(repo): Simplify authMiddleware in the playground/nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
SokratisVidros committed Dec 13, 2023
1 parent cc395d5 commit c31b37e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
14 changes: 3 additions & 11 deletions playground/nextjs/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@ import { authMiddleware } from '@clerk/nextjs/server';
// Set the paths that don't require the user to be signed in
const publicPaths = ['/', /^(\/(sign-in|sign-up|app-dir|custom)\/*).*$/];

export const middleware = (req, evt) => {
return authMiddleware({
publicRoutes: publicPaths,
publishableKey: req.headers.get("x-publishable-key"),
secretKey: req.headers.get("x-secret-key"),
proxyUrl: req.headers.get("x-proxy-url"),
domain: req.headers.get("x-domain"),
isSatellite: req.headers.get('x-satellite') === 'true',
signInUrl: req.headers.get("x-sign-in-url"),
})(req, evt)
};
export default authMiddleware({
publicRoutes: publicPaths,
});

export const config = {
matcher: ['/((?!.+\\.[\\w]+$|_next).*)', '/', '/(api|trpc)(.*)'],
Expand Down
6 changes: 3 additions & 3 deletions playground/remix-cf-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"yalc:add": "yalc add @clerk/types && yalc add @clerk/remix && yalc add @clerk/backend"
},
"dependencies": {
"@clerk/backend": "*",
"@clerk/remix": "*",
"@clerk/types": "*",
"@clerk/backend": "file:.yalc/@clerk/backend",
"@clerk/remix": "file:.yalc/@clerk/remix",
"@clerk/types": "file:.yalc/@clerk/types",
"@remix-run/cloudflare": "^2.0.0",
"@remix-run/cloudflare-workers": "^2.0.0",
"@remix-run/react": "^2.0.0",
Expand Down

0 comments on commit c31b37e

Please sign in to comment.