def on_connect(): app.logger.info('New User Connection') try: user = get_current_user(request) except Exception: return rh.error(**ec.INVALID_USER_PERMISSIONS) connect(request.sid, user)