The answer to you question probably depends on the wording of the subordination provision in your lease (if there is one) and on any subordination agreement that you sgned. You should contact teh new owner of the building to see what the owner's position is on your lease. If you are unsure of your rights and responsibilities or you feel that you are being treated unfairly, you should consult an experienced real estate lawyer in your area.
Disclaimer: This answer is provided for informational purposes only, does not constitute legal advice, and does not create an attorney-client relationship. Actual legal advice can only be provided after completing a comprehensive consultation in which all of the relevant facts are discussed and reviewed.
Assuming the mortgage was in place before your lease, or your lease specifically says it is subordinate to a subsequent mortage, your lease will be terminated by the foreclosure. That is why tenants are typically joined as defendants in foreclosire cases.
The new owner does not have to deal with you.
This is a summary based on incomplete facts. You should not rely on it as legal advise. No attorney-client relationship is intended to be formed. You may call me 772-562-4570; email me firstname.lastname@example.org, or visit my website http://www.millerlawoffices.us