theo
theo
Explore posts from servers
KKinde
Created by theo on 9/8/2024 in #💻┃support
Unable to visit /admin/*
i have a nextjs app that has an admin page with sub pages like /admin/upload /admin/store etc, it all works in localhost, but in prod i get this behaviour, where clicking on the pages, or navigating via the url sends you back to /admin/ any ideas on what it is? im using app router and protecting with matcher: ["/admin/:path*"] in middleware
12 replies
TTCTheo's Typesafe Cult
Created by theo on 8/24/2024 in #questions
indecipherable build error
when building my nextjs app i get the error
Creating an optimized production build ... Failed to compile.

./node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js + 38 modules Cannot get final name for export 'NO_RETRY_INCREMENT' of ./node_modules/.pnpm/@[email protected]/node_modules/@smithy/util-retry/dist-es/index.js

Build failed because of webpack errors  ELIFECYCLE  Command failed with exit code 1.
Creating an optimized production build ... Failed to compile.

./node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js + 38 modules Cannot get final name for export 'NO_RETRY_INCREMENT' of ./node_modules/.pnpm/@[email protected]/node_modules/@smithy/util-retry/dist-es/index.js

Build failed because of webpack errors  ELIFECYCLE  Command failed with exit code 1.
cant find any info on it, I've cleared my node modules and reinstalled everything, I've cleared my next cache, still, cant seem to get anywhere or find anything on it
4 replies
KKinde
Created by theo on 7/16/2024 in #💻┃support
Middleware based protection not working
in my middleware.ts, i have the following code
import { withAuth } from "@kinde-oss/kinde-auth-nextjs/middleware"

export default withAuth(
async function middleware(req) {
console.log("auth", req.kindeAuth)
},
{
isReturnToCurrentPage: false,
loginPage: "/signin",
isAuthorized: ({token}) => {
return token.permissions.includes("admin:admin");
}
}
)

export const config = {
matcher: [
"/admin",
"/about",
]
}
import { withAuth } from "@kinde-oss/kinde-auth-nextjs/middleware"

export default withAuth(
async function middleware(req) {
console.log("auth", req.kindeAuth)
},
{
isReturnToCurrentPage: false,
loginPage: "/signin",
isAuthorized: ({token}) => {
return token.permissions.includes("admin:admin");
}
}
)

export const config = {
matcher: [
"/admin",
"/about",
]
}
however, it simply doesnt protect any routes, while page based protection does work, however i want to avoid using that
7 replies