Fix problem with logout from portals