Solved it by adding the following rule to Auth0:
function addSidToIdToken(user, context, callback) {
// This rule adds the authenticated user's session id (sid) to the id token.
const namespace = 'https://example.com/';
context.idToken[namespace + 'sid'] = user.sid;
callback(null, user, context);
}