If you choose to move forward and legalize the work yourself after purchase, expect a multi-step process: Buying a house with unpermitted work: What you need to know
The consequences of unpermitted work range from minor fines to major structural failures.
: Once you close, you are responsible for any outstanding fines or code violations. The city could eventually force you to demolish the addition at your own expense if it doesn't meet safety standards.