I am working on express js and I need to redirect to a page which needs authentication. This is my code:
router.get('/ren', function(req, res) {
var username = 'nik',
password = 'abc123',
auth = 'Basic ' + new Buffer(username + ':' + password).toString('base64');
res.redirect('http://localhost:3000/api/oauth2/authorize');
})
How can I set headers to this redirect command?