def after_request(res): lsm = LSM(webserver_config) if not lsm.get_login(): lsm.login() return lsm.compose_response(res)