The foreclosure has nothing to do with you. Your lease is what matters. You are not required to leave unless you are evicted. Efforts to remove you early could be illegal. If you are asked to leave early, take the opportunity to demand a buyout for your trouble.