795 questions with no answers
1
vote
0
answers
21
views
Bun + Express on Vercel: How to Modularize Routes from Separate Files?
I'm deploying a Bun + Express application to Vercel. Locally, my Express app works perfectly with routes defined in separate files and imported into index.ts. However, on Vercel, the deployment ...
Advice
0
votes
0
replies
46
views
How to properly build an HR Management System using Laravel (API) + Next.js (frontend) with token authentication and middleware?
I'm building an HR Management System using:
Backend: Laravel
Frontend: Next.js
Authentication(SPA): Laravel Breeze (already set up for backend)
I'm a beginner in Next.js, and I’m a bit stuck on how ...
0
votes
0
answers
98
views
Combining clerk middleware with next-intl middleware
Newbie Next dev here. How do I combine these in src/middleware.ts?
import createMiddleware from 'next-intl/middleware';
import {routing} from './i18n/routing';
export default createMiddleware(...
0
votes
0
answers
38
views
Can't access headers.origin in NextJS middleware (App router)
I'm trying to follow the basic tutorial provided by NextJS to setup a middleware for my API. When trying to restrict origin (for testing purposes) to http://localhost:3000, the request.headers.get('...
0
votes
0
answers
44
views
How to configure middleware to run and be debugged in next.js
Ultimately, I want to route requests to pages within subdomains in my next.js application. If I specify the correct subdomain in a route, I believe that I need to have a middleware.ts file under the ...
0
votes
0
answers
101
views
Next.js Middleware Error: "Cannot read properties of undefined (reading 'substring')" in oidc-token-hash
I'm implementing authentication middleware in a Next.js (v13+) application using NextAuth.js, and I'm encountering an error when trying to validate the session token. The error occurs in the oidc-...
0
votes
0
answers
24
views
Empty HTTP POST request going unhandled in Express.js server
I have an Ubuntu image based docker container working as a development environment. Inside this container, I have my express app. Below are the code files.
// Start the Express Server - index.ts
...
0
votes
0
answers
16
views
Auth middleware fails to check for the session
I have multiple middlewares at the same file, if user is not logged in; the auth middleware will redirect user to login page, the problem is even when user is logged in it will return login page ...
0
votes
0
answers
701
views
Problem with PageSpeed Insights: RPC::DEADLINE_EXCEEDED
I have a problem with my portfolio site: https://www.frontendpolska.pl/pl.
I can't test the site in PageSpeed Insights—I keep getting the error:
RPC::DEADLINE_EXCEEDED: context deadline exceeded
or a ...
1
vote
0
answers
206
views
Redirect from AppController::initialize without running child code
Using CakePHP 3.9:
I'm trying to redirect a user to a page where they can choose which organisation to log in with, if they haven't chosen any. To make sure this happens on every page, I added the ...
2
votes
0
answers
105
views
Why do I have an infinite loop when using a middleware with Scrapy?
I am implementing a program to scrape job offers on a site. However, I have a problem: on this same site links are sometimes programmed with relative href, sometimes absolute (ex: sometimes I have ...
0
votes
0
answers
157
views
Next.js 15 middleware JWT route protection issue (works locally, fails in production)
I'm facing a weird issue with my Next.js App Router (v15) middleware for JWT-based route protection. I'm using jose for token verification because it's Edge-compatible.
The issue is that everything ...
0
votes
0
answers
99
views
How to translate the not-found page in Next.JS
My website has translations, and I want to translate my error pages. But I translate my pages with a dynamic route (/app/[locale]) and not-found.tsx must be at the root (app/not-found.tsx). I don't ...
0
votes
0
answers
59
views
How to dynamically switch databases for multi-tenancy in Django without modifying core settings?
I’m working on implementing multi-tenancy for a Django application, where each tenant will have a separate database. I create the databases dynamically when a new tenant is created and need to switch ...
0
votes
0
answers
52
views
Unsupported type of value in Nextjs
I'm trying to know if a user is banned from my middleware and redirect it to a custom error page. The problems happens when I make the query to the DB from Drizzle ORM, I have created an async ...
0
votes
0
answers
134
views
How to update Request's session in a FastAPI middleware?
I want to change request.session in middleware. But it doesn't change.
@app.middleware("http")
async def renewal_token(request: Request, call_next):
response = await call_next(request)
...
1
vote
0
answers
115
views
Next.js API Route Returns 404 Despite Correct File Structure and Implementation
Problem
I have a Next.js 14 API route that's returning a 404 error despite being correctly implemented and structured. The route exists at app/api/generate-course/route.ts and includes proper POST and ...
0
votes
0
answers
327
views
Clerk Middleware Causing Issues in Production, Works Fine Locally
Clerk middleware is causing issues on the production website, but works correctly in my local development build.
I need the middleware to lock the user on either the authentication page or the form ...
0
votes
0
answers
112
views
migrate express middleware to fastify
I have this middleware that I was making to validate the body of the login request, but it's not working at all, I needed it to say if the email and/or password is missing and return an error before ...
1
vote
0
answers
19
views
Laravel Passport $tokenResult is null, Alternative to Modifying vendor Folder for Rate-Limiting Middleware
I am using Laravel Passport for token authentication and facing an issue where $tokenResult is null. I suspect the default rate limit (throttle:60,1) is exceeded, so I temporarily modified the vendor\...
0
votes
0
answers
26
views
GoogleWebAuthorizationBroker AuthorizeAsyncCore on iOS (IPhone) from Middleware .net Core Web API
I'm using a solution involving similar code to that which is explained here: How do I set return_uri for GoogleWebAuthorizationBroker.AuthorizeAsync?
What I've discovered after getting the code to ...
0
votes
0
answers
46
views
Why is authorize not recognized in Nexus field configuration despite using fieldAuthorizePlugin?
I'm using Nexus with the fieldAuthorizePlugin to add an authorize function to my GraphQL schema fields for handling authentication. While everything works correctly at runtime (with @ts-ignore above ...
0
votes
0
answers
25
views
import model in next js middleware
i am developing a fullstack app with next js.
for authentication, I need import User model file in my middleware.ts but when I import this in middleware file, Next.js return this error to me
export ...
0
votes
0
answers
488
views
Next.js Middleware and Cookie Issue: Logout Not Clearing Cookie Consistently
Problem Statement
I'm working on a Next.js app where I need to manage user authentication with cookies. I have set up login, logout, and middleware files for handling JWT tokens and securing routes. ...
0
votes
0
answers
37
views
Correct way to Middleware with NodeJS, ExpressJS, Tokens (Login & Dashboard)?
Hope your'll fine. We'll I have a problem using NodeJS, especifically with a Middleware, in my case it supposed to have a Dashboard with two cases:
If user try to go /dashboard without login -> ...