Add session/url param state check in auth/callback

This commit is contained in:
Mészáros Mihály 2020-11-05 10:44:40 +01:00
parent 419a24f9e8
commit 7095d6b98e

View file

@ -512,6 +512,13 @@ async function setupAuth()
if (req.method === 'POST')
state = JSON.parse(base64.decode(req.body.state));
}
if (!state || !state.peerId || !state.RoomId)
{
res.redirect('/auth/login');
logger.debug('Empty state or state.peerId or state.RoomId in auth/callback');
}
const { peerId, roomId } = state;
req.session.peerId = peerId;