decodeHeaders static method
void
decodeHeaders(
- Response response
Implementation
static void decodeHeaders(Response response) {
if ((!response.headers.containsKey(HttpHeaders.authorizationHeader)) ||
(isNullOrEmpty(response.headers[HttpHeaders.authorizationHeader]))) {
return;
}
// authorization header
String token = response.headers[HttpHeaders.authorizationHeader]!
.replaceAll("Bearer", "")
.trim();
// decode token
Jwt jwt = Jwt.decode(token);
if (jwt.valid) System.currentApp?.logon(jwt);
}