Added start page

This commit is contained in:
Stefan Otto
2018-11-16 12:41:48 +01:00
parent 60322c57c6
commit 3520cfea93
3 changed files with 84 additions and 5 deletions
+7 -2
View File
@@ -57,7 +57,7 @@ app.all('*', (req, res, next) =>
app.use(dataporten.passport.initialize());
app.use(dataporten.passport.session());
app.get('/login', (req, res, next) =>
app.get('/login', (req, res, next) =>
{
dataporten.passport.authenticate('dataporten', {
state : base64.encode(JSON.stringify({
@@ -65,12 +65,17 @@ app.get('/login', (req, res, next) =>
peerName : req.query.peerName,
code : utils.random(10)
}))
})(req, res, next);
});
dataporten.setupLogout(app, '/logout');
app.get('/', function (req, res) {
console.log(req.url);
res.sendFile(`${__dirname}/public/chooseRoom.html`);
})
app.get(
'/auth-callback',
dataporten.passport.authenticate('dataporten', { failureRedirect: '/login' }),