Here's something interesting I just found... this is language from the Terms and Conditions of an application for a loan from the North Jersey Federal Credit Union:
"If Credit Union has a federal charter: Statutory Lien - If you are in default on a financial obligation to us, federal law give us the right to apply the balance of shares and dividends in all individual and joint accounts you have with us to satisfy that obligation. After you are in default, we may exercise this right without further notice to you. (We have a federal charter if our name includes the term "Federal Credit Union.") If Credit Union has a state charter, except in Ohio and Rhode Island: We have a statutory lien on the shares and dividends and, if any, the deposits and interest in all individual and joint accounts you have with us and may exercise our rights under the lien to the extent permitted by state law. (We have a state charter if our name does not include the term "Federal Credit Union.") For all borrowers: You pledge as security for this loan all shares and dividends and, if any, all deposits and interest in all joint and individual accounts you have with the credit union now and in the future. The statutory lien and/or your pledge will allow us to apply the funds in your account(s) to what you owe when you are in default. The statutory lien and your pledge do not apply to any Individual Retirement Account or any other account that would lose special tax treatment under state or federal law if given as security."
https://www.njfcu.org/secure/frm_loanapp.aspx
This language means that both federal law and state law give credit unions a lien on the assets of all accounts you have with them, and they are permitted by law to attach those assets to repay any loans you have with them which are in default.
So both federal law and state law give them the authorization to take funds from your checking account to pay the line of credit.
I haven't found the specific federal law that permits this but I have no doubt that it exists.