Monday, 13 March 2017

Express.js - Session undefined when handling Webhook

So I'm handling a webhook from Github that sends a POST each time something happens with for example an issue. In my application, I've set a Session-cookie, but when handling the POST from the github-webhook, the session seems to not be stored.

router.route("/")
.get((req, res) => {

    res.redirect("/somepage");
})

.post((req, res) => {

    console.log(req.session.Auth) // => undefined

    res.end();
});

The webhook sends a post to my application that's handled here, but the session.Auth is empty. It's not empty on other requests. I guess it has something to do with the POST I'm getting from github doesn't store my values. Do anybody know if you could fix it?



via Jesper

No comments:

Post a Comment