Reactjs – Nextjs middleware not being evoked
I have a mono repo project working with NX. All is working fine, but I tried to add a middleware and it isn't being caught in the requests. I tried to put it in all different places and with _…
I have a mono repo project working with NX. All is working fine, but I tried to add a middleware and it isn't being caught in the requests. I tried to put it in all different places and with _…
Laravel 11 does not come with a middleware file and the kernel.php file has been removed altogther. So, when I create a custom middleware, how do I register it? I do not know where to register middleware. Laravel 11 has…
In laravel auth middleware i create session variable and store the the last entering time like class Authenticate extends Middleware { public function handle($request, Closure $next, ...$guards) { if (auth()->check()) { session()->put('activity_time', now()->toDateTimeString()); } return parent::handle($request, $next, ...$guards); } protected…
I am trying to redirect a user to /login if the authentication token from Laravel is not valid. So I am trying to fetch the user and if resp.ok() is false then I delete the invalid "token" cookie and redirect…
I set up a Laravel and an Express Node and I want to eliminate the "Server" label that the server returns in the response. I made a middleware to remove said label but I still can't remove it. Does anyone…
I'm working on a Next.js application, and I have a specific page, let's call it "thank-you," that I want to prevent users from accessing directly via the URL. However, I want to allow access to this page only through internal…
I'm creating an application using React and Laravel (Sanctum). Checking whether a user is logged in or returning user data works very well, but only within the auth:sanctum middleware. The problem is that in that case, the route won't work…
I need to prepare a set of dates and store them in Session variables when the user reloads the page. This is done from the Controller. This is a problem because the app calls about 18 different controllers on each…
I'm currently working on a Laravel project where I need to set up dynamic subdomains for each user. These subdomains should route requests to individual user profiles and apply middleware for authentication and security. Each user's subdomain should be generated…
I got some error that says 'Cannot do inclusion on field guides in exclusion projection', this happen bcs I tried to populate data using pre middleware in my schema: const tourSchema = new mongoose.Schema({ ... guides: [ { type: mongoose.Schema.ObjectId,…