prautoblogger_cloudflare_ai_token was missing from the $encrypted array in sanitize_field(), so the token was stored as plaintext. On read, decrypt() failed on the non-encrypted value and returned empty string, causing HTTP 401 on every Cloudflare Workers AI call. Fix: add the field to the encrypted list so future saves encrypt it. Also add legacy plaintext detection in get_api_token() and the validator so the existing DB value works immediately and gets auto-encrypted on first use. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3.8 KiB
3.8 KiB