Some error checks

auto_join_3.3
Håvar Aambø Fosstveit 2020-05-08 16:20:15 +02:00
parent a49258e840
commit d09e7f5565
1 changed files with 38 additions and 30 deletions

View File

@ -368,7 +368,9 @@ async function setupAuth()
app.get( app.get(
'/auth/callback', '/auth/callback',
passport.authenticate('oidc', { failureRedirect: '/auth/login' }), passport.authenticate('oidc', { failureRedirect: '/auth/login' }),
async (req, res) => async (req, res, next) =>
{
try
{ {
const state = JSON.parse(base64.decode(req.query.state)); const state = JSON.parse(base64.decode(req.query.state));
@ -401,6 +403,11 @@ async function setupAuth()
picture : peer.picture picture : peer.picture
})); }));
} }
catch (error)
{
return next(error);
}
}
); );
} }
@ -586,6 +593,7 @@ async function runWebSocketServer()
{ {
logger.error('room creation or room joining failed [error:"%o"]', error); logger.error('room creation or room joining failed [error:"%o"]', error);
if (socket)
socket.disconnect(true); socket.disconnect(true);
return; return;