Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
71 views

I want to pass the data from the NextJS middleware to the client component. I am using NextJS for the frontend, and an Express API for the backend. I could do it with X-Headers but what I want to send ...
GlicyDev's user avatar
Best practices
0 votes
3 replies
68 views

Adding [ApiController] on a controller class has various benefits. Especially the automatic model validation and problem details parts. The problem with this attribute is that it's easy to forget to ...
LLL's user avatar
  • 3,781
1 vote
0 answers
29 views

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 ...
Dev Ayush's user avatar
  • 143
Advice
0 votes
0 replies
48 views

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 ...
Shashi Kelum's user avatar
-1 votes
0 answers
111 views

My goal is to have a special route which receives name and payload for any other route and then (after doing some unpacking and decoding) call the target route which I prefer to go through HTTP ...
Ali Ebrahimi's user avatar
1 vote
1 answer
83 views

I am doing unit testing for my project. This is the code I want to test: import { create } from "zustand"; import { persist } from "zustand/middleware"; interface LanguageState { ...
Lollypop123445's user avatar
-4 votes
1 answer
71 views

I need want to send the only authenticated user to the /chat route in next js how to do ut using the middleware? Although I created a middleware and place it inside the root folder it dosen't detect ...
Sudam Ranasinghe's user avatar
2 votes
1 answer
84 views

I’m building an authentication system with Express + JWT + Cookie. I have a middleware userAuth that decodes the token and puts the userId into req.body. Here is the code: import jwt from "...
Ridwan Anugrah's user avatar
2 votes
1 answer
127 views

This is the code below. I want to test a request coming in that has part of its path prefixed by external means. This middleware removes it before servicing the request. app = FastAPI( title="...
Kevin Piotrowicz's user avatar
0 votes
0 answers
52 views

When deployed, it fails Cookie validation Bypass Vercel firewall rules for API routes even though cookie + header is seen from the browser middleware.ts import { NextResponse } from 'next/server'; ...
Dumindu Jayasekara's user avatar
0 votes
0 answers
44 views

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('...
Horkos's user avatar
  • 411
0 votes
2 answers
201 views

I’m working on a Next.js 14 app with the App Router and next-auth@5. I followed the official Next.js Learn guide on authentication, except I replaced email with username in the database. I set up ...
Noctyris's user avatar
0 votes
0 answers
26 views

I understand that middleware functions in Express use the (req, res, next) signature and are added using app.use() But since a route handler also receives (req, res) or even (req, res, next), is it ...
muneeb malik's user avatar
0 votes
1 answer
132 views

I was recently in a technical discussion with a senior developer and was asked: What is the difference between RequestDelegate and Middleware in ASP.NET Core? I have already visited the following ...
phougatv's user avatar
  • 1,060
2 votes
1 answer
176 views

I'm working on an ASP.NET Core Web API where I use session middleware with a configured idle timeout, e.g.: services.AddSession(options => { options.IdleTimeout = TimeSpan.FromMinutes(20); }); ...
Tom's user avatar
  • 1,344
0 votes
1 answer
97 views

I'm new to TYPO3 v13 and am currently trying to write a small login middleware, really simple at first. But somehow I can't get any further with $request->getAttribute(‘fe_user’). It always returns ...
user30962528's user avatar
1 vote
0 answers
24 views

This setup only seems to work when I update or refresh my OpenAPI (Swagger) spec. When I call real API endpoints, apitallyRouter middleware doesn’t get triggered at all (no logs, no requests sent to ...
Doni Abdumutalibov's user avatar
1 vote
0 answers
158 views

I created authentications using Better-Auth and Google as the auth client. I have the correct URL for the authorized JavaScript origins and for the authorized redirect URL and I believe my set up is ...
Elijah Davis's user avatar
0 votes
1 answer
224 views

I am using Laravel sanctum SPA auth to protect my routes/api.php routes. Instead of manually implementing the routes and controllers for authentication, I am using Laravel Fortify. Now Fortify adds ...
Nelize du Toit's user avatar
0 votes
0 answers
44 views

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 ...
IMOsiris's user avatar
  • 155
0 votes
1 answer
74 views

How to implement lazy initialization of authjs (v5 beta) config in nextjs 14 without encountering the error Error: The Middleware "/src/middleware" must export a middleware or a default ...
Tejas's user avatar
  • 27
0 votes
1 answer
106 views

What is the difference between the methods ctx.AbortWithStatusJSON() and ctx.JSON()? As I understand it, the first one calls TWO methods inside itself - Abort(), which interrupts the processing of the ...
DimaMsuVmk22's user avatar
2 votes
1 answer
138 views

I am intending to specify the single origins where I want my different endpoints to receive requests from. After looking at different options I thought that this might be the simplest way, and it ...
sg_b's user avatar
  • 23
1 vote
1 answer
153 views

Next.js allows you to create routing groups to organize your project. I would like to use this information in a middleware to distinguish private groups that need authentication from public routes. E....
René Link's user avatar
-1 votes
1 answer
62 views

I'm sure this has been asked and answered, but maybe I'm not able to phrase it correctly to find the right results. Say I have two redux middleware operations: a call to create an asset entity in the ...
micahg's user avatar
  • 36
3 votes
2 answers
7k views

I am currently working with Laravel 12.13 and facing an issue with CORS. I have configured the HandleCors middleware and the CORS settings in my application, but I am still getting CORS errors when ...
Anna Pons's user avatar
1 vote
1 answer
63 views

user redirected to login page after a trying to access a protected page. I am storing the protected page url in search params and after login redirect to that page. (my approach works on localhost ...
Mahadi Hasan's user avatar
0 votes
0 answers
108 views

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-...
user avatar
0 votes
1 answer
87 views

I'm working on an ASP.NET Core web application with custom localization using JSON files. I'm trying to change the language at runtime and reflect it immediately in the current request. Here's what I ...
Soner Kochan's user avatar
0 votes
1 answer
109 views

I'm building my web app with Next.JS and React JS. I'm currently using middleware for some tasks like checking user's authentication while accessing the URL and refreshing tokens if needed. However, I ...
Hoangdz's user avatar
  • 333
0 votes
1 answer
75 views

I'm facing an issue in my Next.js 15 application. I am setting the jwtToken in the cookies when a user logs in. I have verified this through the browser's Application tab in the developer tools, where ...
Ali Ahmed's user avatar
0 votes
1 answer
69 views

Hello I want to add a middleware to implement a filter request in my frontend. Basically the workflow is the following: User login in page localhost:3000/auth Backend replies ok with access_token set ...
El Pandario's user avatar
0 votes
1 answer
47 views

after some work i found out that when using server actions to hit some route handler the session will be undefined because server actions run on the server without a request context from the browser, ...
aasem shoshari's user avatar
0 votes
1 answer
211 views

I have an Azure Durable Function that worked before I added custom middleware. Do Azure Functions work with custom middleware? I've added the middleware to manage custom authentication and to ...
EnenDaveyBoy's user avatar
0 votes
1 answer
165 views

OBS: text translated with the help of AI I am trying to use a middleware in Next.js to rewrite the URL for a subdomain (like dividas.dominio.com) to /dividas. The behavior works correctly in the ...
Fernando Leão's user avatar
0 votes
0 answers
34 views

My team and I are building a web app with Next.JS, and we are mainly working on Front-end. The back-end was already implemented with another language because it's shared with our mobile apps. Now I'm ...
Hoangdz's user avatar
  • 333
1 vote
2 answers
126 views

I have this alias middleware which supposed to manually initialized the queries. exports.aliasTopTours = (req, res, next) => { req.query.limit = '5'; req.query.sort = '-ratingsAverage,price'; ...
Dumb_Developer's user avatar
0 votes
1 answer
389 views

I’m working on a front-end project using Next.js 15, where the backend is separate and responsible for user authentication. The flow is as follows: I send the user credentials (email and password) ...
Amr Gaafer's user avatar
0 votes
0 answers
28 views

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 ...
Aakash's user avatar
  • 33
0 votes
2 answers
64 views

I am following the documentation of slim 4 middleware at Docs I was able to implement the before middleware. But not sure how to implement after middleware. It says the DI should be used but the code ...
Alaksandar Jesus Gene's user avatar
0 votes
2 answers
58 views

I have an integration test using a WebapplicationFactory in .Net 9 to spin up the main Program.cs and hit endpoints. My problem is often an endpoint will return a generic 500 error when an unhandled ...
The Lemon's user avatar
  • 1,467
0 votes
1 answer
55 views

I'm using Scrapy's built-in CrawlOnce middleware, and when I stop and restart a job, I sometimes get this error: Traceback (most recent call last): File "/app/tasks/crawl.py", line 250, in ...
ProblemSolver's user avatar
0 votes
0 answers
18 views

I have a confusing situation with NextJS and session cookies and middleware, the flows are: New user hits site -> middleware creates a new anon session token and sets the set cookie header in the ...
Rob Sanders's user avatar
  • 5,425
0 votes
0 answers
47 views

Need to catch HTTPException raised in route in middleware. Raise exception in route: @worker.get("/v1/error_400") async def error_400(): raise HTTPException( status_code=400, ...
Unknown.Vagrant's user avatar
0 votes
0 answers
20 views

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 ...
Aasem Shoshari's user avatar
1 vote
1 answer
1k views

I want to configure rate limiting with SlowAPI (in-memory, without Redis Cache etc.), but I don't want to add the @limiter.limit() decorator seperately for every endpoint. So, something I don't want ...
Jan's user avatar
  • 31
0 votes
1 answer
60 views

I'm trying to authenticate using an identity provider that has its token endpoint on /profile/oidc/token instead of the usual /oauth/token endpoint. Is there any way to customize this? I'm always ...
BG931c's user avatar
  • 1
0 votes
0 answers
18 views

Intro Hello, I am using the following files for my NextAuth configuration. When I use a server action inside the authorize method I get the edge error. I tought that the authorize method does not run ...
uivlis's user avatar
  • 1
1 vote
2 answers
153 views

I am currently finalizing a payment system in my ReactJS - FastAPI web app, and I'm facing a problem. Indeed, I use stripe for payments and I use the stripe webhooks system to update the user infos in ...
Digicem's user avatar
  • 33
1 vote
1 answer
480 views

I am trying to enforce a global request timeout in my FastAPI application using a custom TimeoutMiddleware. The middleware is supposed to cancel any request that takes longer than the specified ...
Hassan's user avatar
  • 33

1
2 3 4 5
94