Fix https redirect
parent
b5f50fd580
commit
d7ce8253e2
|
|
@ -43,14 +43,12 @@ const dataporten = new Dataporten.Setup(config.oauth2);
|
||||||
|
|
||||||
app.all('*', (req, res, next) =>
|
app.all('*', (req, res, next) =>
|
||||||
{
|
{
|
||||||
if(req.headers['x-forwarded-proto'] == 'http')
|
if(req.secure)
|
||||||
{
|
|
||||||
res.redirect('https://' + req.hostname + req.url);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res.redirect('https://' + req.hostname + req.url);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(dataporten.passport.initialize());
|
app.use(dataporten.passport.initialize());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue