Open gawen opened 7 years ago
Hello,
I am unable to apply a DigestStrategy to a route defined in a express' Router.
DigestStrategy
Router
Here's the following snippet. Note the variable use_router.
use_router
var handler = function(req, res) { res.json({"hello": "world"}); }; if (use_router) { var router = express.Router(); router.get('/', passport.authenticate('digest', {session: false}), handler); app.use("/hello", router); } else { app.get('/hello', passport.authenticate('digest', {session: false}), handler); }
I expected to received {"hello": "world"} if I GET on /hello the right username (any value) and password ("password").
{"hello": "world"}
GET
/hello
"password"
curl -v --user user:password --digest http://localhost:8888/hello
It does when use_router is false, BUT it does not when use_router is true.
false
true
I would expect aaplying a DigestStrategy to a route registered in a router to work, but it appears it does not.
Used versions:
Hello,
I am unable to apply a
DigestStrategy
to a route defined in a express'Router
.Here's the following snippet. Note the variable
use_router
.I expected to received
{"hello": "world"}
if IGET
on/hello
the right username (any value) and password ("password"
).It does when
use_router
isfalse
, BUT it does not whenuse_router
istrue
.I would expect aaplying a
DigestStrategy
to a route registered in a router to work, but it appears it does not.Used versions: