Questions tagged [middleware]

Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue".

Middleware is a software component (or components) that sits "in the middle" between applications and the operating system. Typically, middleware will facilitate application development by providing services such as communications, file access, or thread locking that have a common Application Programming Interface (API) across multiple operating systems.

Communications Middleware is a specific kind of middleware that allows for interprocess communications (on one machine or across a network). The purpose of Communications Middleware is to simplify the designing, programming, and managing of software applications by streamlining the way these applications receive and process data. Communications Middleware simplifies writing communications software while providing sophisticated built-in features, reducing development costs.

Examples of communications middleware include:

4333 questions
9
votes
9 answers

How to check user status while login in Laravel 5?

I have used Laravel Authentication (Quickstart). But I need to check the status of the user (approved/pending). If not approved, then an error will be shown in the login page. I need to know in which file I have to make the change and what is the…
Zaman
  • 117
  • 1
  • 2
  • 10
9
votes
1 answer

nodeJs/Express dealing with missing static files

I have a node App. That is configured to serve static files by: app.use(express.static(path.join(__dirname, '../public'))); And I use some auth middlewares on other routes. The problem comes up when I hit an image that doesn't exist on the…
Max
  • 211
  • 3
  • 7
9
votes
6 answers

Laravel Session Middleware broken

On my local system everything works fine, but after deploying Laravel 5.2 on our test system it looks like the session middleware is broken. Can someone help here? Argument 1 passed to Illuminate\Session\Middleware\ …
DehMotth
  • 679
  • 3
  • 12
  • 21
9
votes
4 answers

AttributeError: 'WSGIRequest' object has no attribute 'session'

I keep getting this error at random times and whenever I touch the django.wsgi file, it gets fixed only to happen again after a few hours. I'm lost as to what to do. my middleware_classes is as follows: MIDDLEWARE_CLASSES = ( …
9
votes
4 answers

OWIN OpenIdConnect middleware - set RedirectUri dynamically

Is there any way how can I set RedirectUri property for OpenIdConnectMessage based on a Request scope, not Application scope? My app is serving multiple domains (myapp.com, myapp.fr, ..) and based on domain, it determine default language for the…
Antonin Jelinek
  • 2,277
  • 2
  • 20
  • 25
9
votes
2 answers

How can I inspect the set of Express.js middleware that is being used?

Backstory: I'm trying to debug an issue in one piece of middleware that I think is coming from other piece. But, I'm not sure. So anyway, I would like to be able to check what middleware is actually being called, because I'm not sure of the…
hrdwdmrbl
  • 4,814
  • 2
  • 32
  • 41
9
votes
1 answer

Two Express "app"s in one NodeJS server?

I want to be able to pass different requests through different Express middleware stacks. I think I need two express apps, and some way to branch. e.g.: var app = express(); var alt_app =…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
9
votes
1 answer

Flask middleware on abort 401 causing a 500

I have a middleware in my Flask app that is used to authenticate a JSON Web Token coming in the header of the request and is checking to verify it, below is my middleware class: class AuthMiddleware(object): def __init__(self, app): …
quack_quack
  • 93
  • 1
  • 4
9
votes
1 answer

Node, express.session as middleware does not set cookie

this question is related to NodeJS + Express - Apply session middleware to some routes which I first thought would solve my problem. But it did not. I'm trying to build a site where the first default-page show the user info about the site needing to…
northmoose
  • 139
  • 1
  • 1
  • 6
9
votes
1 answer

Socket.io namespaces and server don't share middleware?

I'm created some passport authentication middleware for my socket.io/express app. It looks like: io.use(function (socket, next) { var data = cookie.parse(socket.handshake.headers.cookie); var sessionID =…
Chris Anderson
  • 8,305
  • 2
  • 29
  • 37
9
votes
5 answers

Facebook Open Graph without a browser

For a middleware system with internet (which works inside a set-top box) I want to develop a primitive Facebook interface where users can type their user-names and password, showing their latest notification, messages and other casual stuff on the…
Hellnar
  • 62,315
  • 79
  • 204
  • 279
9
votes
2 answers

How to rescue custom exceptions coming from a middleware in Rails 3.2?

I have a Rails 3.2 application that uses Apartment, which is used as a middleware. Apartment throws an Apartment::SchemaNotFound exception and there is no way to rescue it with rescue_from from the ApplicationController. I thought I'd use…
Robert Audi
  • 8,019
  • 9
  • 45
  • 67
9
votes
9 answers

Best Publish/Subscribe "Middleware"

I'm in the market for a good open source network based Pub/Sub (observer pattern) library. I haven't found any I like: JMS - tied to Java, treats message contents as dumb binary blobs NDDS - $$, use of IDL CORBA/ICE - Pub/Sub is built on-top of…
David
  • 2,533
  • 2
  • 18
  • 16
8
votes
2 answers

How to catch a route and redirect to Another Page in Nuxt 3

I have a website that I have rebuilt using Nuxt 3. Backlinks exists on numerous platforms and I need the old links to point to the new pages. Example: old(website.com/contact.html) new(website.com/contact) I tried using middleware, but after…
Kyrony
  • 419
  • 4
  • 13
8
votes
3 answers

Next.js cookies aren't coming through on router middleware

I'm attempting to create some route guarding using the new Next.Js 12 middleware feature. My authentication is based on a JWT token set on a cookie. I had previously implemented this using the API backend on Next.Js with no issues, and still when…
Koobz866
  • 166
  • 1
  • 2
  • 17