clearAuthentication method

void clearAuthentication()

Limpa toda a autenticação e libera recursos

Após chamar este método, será necessário autenticar novamente antes de fazer qualquer requisição.

Exemplo

apiClient.clearAuthentication();
// Agora é necessário chamar authenticate() novamente

Implementation

void clearAuthentication() {
  _authModel = null;
  _contribuinteNumero = null;
  _httpAdapter?.dispose();
  _httpAdapter = null;
  _authService = null;
  _storedCredentials = null;
  _cloudFunctionCertBase64 = null;
  _cloudFunctionCertPassword = null;

  // Limpar cache estático do serviço de procurador
  AutenticaProcuradorService.limparCache();
}