signOut method
Implementation
Future<void> signOut() async {
try {
final url = apiBaseUrl(_config.domain, _config.authBasePath, 'signout');
await _config.httpClient.post(
url,
body: {'csrfToken': await getCSRFToken()},
options: HttpClientOptions(
contentType: 'application/x-www-form-urlencoded',
responseType: HttpClientResponseType.plain,
cookies: await _getCookieList(attachAccessToken: true),
followRedirects: false,
validateStatus: (status) {
return status != null && status < 500;
},
),
);
} catch (e) {
logger?.error('signOut error', e);
} finally {
await _tokenCache.clearAll();
}
}