How long am i legally allowed to pump at work?

Anyone know?

I’ve heard 1 year and I’ve heard until I finish breastfeeding (but within reason I guess?)

What’s the legality of it? I work at a hospital if that makes a difference.

Baby just turned 1 year and I’m still pumping twice a day during a work day. Idk if they’re going to start being like wtf. But also I don’t wanna be forced to stop.