Do not panic, there are several laws that protect you and if you play your cards right you can actually do pretty well.
By law, the foreclosure can happen and the bank will effectively be your new landlord. As long as you have a copy of your executed lease, the bank must abide by the terms of the lease as long as it is a bona fide lease. That is, the lease was an arms length transaction, (you are not in any way related or doing business with the landlord) and that the rent you are paying is equivalent to market rent for similar homes in the area. Additionally the timing of when you executed the lease does carry some weight. This is something you need to do a little research about, I think that if the lease was executed prior to the notice of trustee sale, then you are fine. If the lease was executed after the notice of trustee sale, then there could be some issues. It is easy to look up when the notice of trustee was issued, if you want you can pm me the address.
So if the above was true then that lease cannot be broken and you are good to go. Now, at some point after the trustee sale, you will be contacted by the entity that owns the property or a property manager who represents them. Simply have a copy of the lease and give it to them. If you are smart, you can let them know you would okay with breaking the lease and letting them have the home, (for the right price of course, maybe a few thousand bucks and the cost of the moving expense)…
You are not gonna strike it rich… don’t think you can get more then a few thousand… but still, better then nothing. Or if you don’t wanna move simply hang out until the lease expires and then move.