setAuth method
Loads the stored auth token and cookies into the request headers.
Implementation
Future setAuth() async {
dynamic auth = await _storageService.readSecureData('authState');
if (auth != null) {
auth = jsonDecode(auth);
if (auth["token"] != null) {
_headers['Authorization'] = 'Bearer ${auth["token"]}';
}
}
dynamic cookies = await _storageService.readSecureData('cookies');
if (cookies != null) {
_headers['cookie'] = cookies;
}
return;
}