Centralize all Forgejo HTTP in app/services/forgejo.py (get/post + authorize_url/exchange_code/fetch_user, typed ForgejoError, defensive base-URL join). Centralize credential encryption in app/auth/tokens.py (decrypt_pat/set_pat, set_client_secret/decrypt_client_secret) so the get_fernet()+crypto+column pattern no longer leaks into routers. auth/settings/setup now delegate to these modules; the duplicated client-secret encrypt block and per-call httpx clients are gone.
0 lines
Python
0 lines
Python