LionC / express-basic-auth

Plug & play basic auth middleware for express
328 stars 57 forks source link

Allow previos authentication middlewares. #35

Open LaKing opened 4 years ago

LaKing commented 4 years ago

I think a good approach would be to check if req.auth exists already. If yes, a previous method already authenticated.

return function authMiddleware(req, res, next) {
        if (req.auth) return next();
...
LionC commented 1 year ago

Good point, but would be a breaking change, so this will have to wait for v2