Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
1k views

As title says, how to you write middleware in SvelteKit? I know to do it in hooks.server.ts. I succeed to intercept server requests, but it would be ideal to make interceptor or middleware for both ...
Blagoje's user avatar
  • 148
0 votes
1 answer
487 views

I'm working on a Hono application using Prisma and the withAccelerate extension. I'm encountering a TypeScript error when trying to set the extended Prisma client in the context. Here is my code: ...
Rishikesh Solapure's user avatar
1 vote
0 answers
91 views

I'm developping an API with PHP Slim 4 with JWT authentication. I want to log every request in AWS CloudWatch. It works, but I want to add in AWS CloudWatch a part of JWT decoded token. I use tuupola/...
Julien's user avatar
  • 185
5 votes
1 answer
1k views

My files are as follows. I have been trying for several days with more than a thousand combinations but I always get the same result. Middleware.js: import { NextResponse } from "next/server&...
Hüseyin APA's user avatar
-2 votes
1 answer
505 views

I'm new in laravel and I confused to how can I register middleware without making it global. in the documentation I only found it to be registered like this (bootstrap\app.php): this resulting every ...
excound's user avatar
  • 25
1 vote
1 answer
71 views

I'm learning Express.js and I'm a bit confused about the difference between middleware functions and route handlers. I understand that middleware functions usually have the next argument, but I'm not ...
prajitha k's user avatar
1 vote
2 answers
2k views

I want to set/update a cookie on the incoming request in the middleware file before the page or layout reads the cookie, but it seems to not be working. Maybe it's not possible.. I made a demo project ...
TJBlackman's user avatar
  • 2,383
1 vote
1 answer
506 views

Lately, I have been trying to implement a strategy for dealing with exceptions in my C# ASP.NET Core application with no success. This strategy is structured in two parts: The first is to have a piece ...
Philipe Riskalla Leal's user avatar
0 votes
1 answer
831 views

I'm creating a middleware function that authenticates the incoming request. I've read the docs for Axum and some other examples. I'm stuck on a compiler trait error. Here is the slimmed down code: #[...
Lacrosse343's user avatar
0 votes
0 answers
275 views

In my application I'm sending Authorization bearer token in middleware I need to get the Authorization but it always coming null Below are the codes page.tsx "use client"; import { useMemo }...
hiimwillow's user avatar
1 vote
2 answers
2k views

I have a api project with Laravel 11, and i want to make a middleware for admin api. AdminMiddleware.php (custom middleware) <?php namespace App\Http\Middleware; use Closure; use Illuminate\Http\...
Fieza Ghifari's user avatar
5 votes
1 answer
3k views

Hello dev friends over there. I faced an issue with Firebase authentication in Next(TypeScript). I want to control with middleware about something like permission access. But, When I use the auth....
Sam B's user avatar
  • 53
1 vote
0 answers
208 views

I am getting the error [NotAuthorizedException: Unauthenticated access is not supported for this identity pool.] I am using Next Js 14.2 version. We are using Amplify v6 gen 1 and I am trying to get ...
Shubham Joshi's user avatar
0 votes
2 answers
511 views

I have a Django backend that returns an httpOnly cookie on successful login. This cookie is required for accessing protected routes in the Next app. I have a middleware that checks if a protected ...
U. Watt's user avatar
  • 794
1 vote
0 answers
74 views

I'm looking a way to pass data from the clerk middleware to the page (or auth object). I couldn't find anything yet. export default clerkMiddleware(async (auth, req) => { const { userId } = auth()...
Diego Ulloa's user avatar
-1 votes
1 answer
47 views

I am trying to add middleware to my apiSlice to console.log something on each and every request, however I do not see any logs (the whole thing works, I just don't see any logs). apiSlice const ...
jukenduit's user avatar
  • 393
0 votes
1 answer
845 views

I'm trying to make NextJS middleware mark dynamic routea under /dashboard/[user] as protected thereby performing auth checks when navigating to and from such route. However, I have been unable to do ...
SamOlisa's user avatar
0 votes
1 answer
47 views

I'm trying to create a class where I can pass in an interface and the class which inherits the interface. I will later call a method and use the interface and class to register a Transient service. ...
SteinTech's user avatar
  • 4,144
1 vote
0 answers
128 views

I am using Next.js version 14.1.0, and I have created a file named middleware.js in the src directory. My src folder contains the following subdirectories: app common components Within the app ...
Umar Raza's user avatar
1 vote
2 answers
658 views

I'm trying to forward traffic to a specific slug based on the user's country code after an IP address lookup. It works perfectly locally but it's not working when I deploy to Netlify. export default ...
Jack Barham's user avatar
  • 3,219
1 vote
0 answers
283 views

I'm having trouble accessing the cookies of a Response object in NextJS middleware. From my understanding, when a login is successful at the /api/auth/login endpoint, it sets a cookie on the Response. ...
yoonjae's user avatar
  • 91
0 votes
1 answer
1k views

I'm trying to implement a middleware for my Azure Functions type HttpRequest, I'm using the IFunctionsWorkerMiddleware interface in .NET 6: public class HistoryLogMiddleware : ...
Dr oscar's user avatar
  • 407
0 votes
0 answers
132 views

I am presently encountering an issue with catching errors in ASP.NET's JSON serialization middleware. Specifically, with the following code. var apiEntity = ModelSerializer.ToApi(entity); ...
slastine's user avatar
0 votes
0 answers
210 views

I am struggling to create a simple jwt cookie authentication middleware where what I want is if there is no cookie to redirect to login and if there is to redirect to dashboard route here is my ...
SDB's user avatar
  • 11
0 votes
1 answer
445 views

Using fastapi, I'm struggling with adding "login_required"(or smh) middleware. (I think middleware is the best idea, and if I dont get normal solution for my problem, I will have to work ...
John Dow's user avatar

1
3 4
5
6 7
94