Closed corysabol closed 8 years ago
Verify the webid that is supplied once the application is accessed. Please see the following code. It already verifies the webid.
The code should serve two routes, one that is restricted and requires a valid webid to be accessed. The certificate will be in the users session you can see some similar code to what you will need to write here.
webid.verify(sess.cert, function (err, result) {
if (err || sess.cert == {}) {
redirect_uri = '/unauthed';
} else {
redirect_uri = '/authed'
}
console.log(result);
sess.authed = true;
console.log(sess.authed);
req.session = sess;
res.redirect(redirect_uri);
});
Where sess is the current session and webid is the webid module.
Agent auth now implemented as a separate module.
Verify a given WebID.