[#1665] Use clear_auth_functions_cache() instead of messing with private vars