authHeaders property

Future<Map<String, String>> authHeaders

Convenience method returning a <String, String> map of HTML Authorization headers, containing the current authentication.accessToken.

See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization.

Implementation

Future<Map<String, String>> get authHeaders async {
  final String? token = (await authentication).accessToken;
  return <String, String>{
    'Authorization': 'Bearer $token',
    // TODO(kevmoo): Use the correct value once it's available from authentication
    // See https://github.com/flutter/flutter/issues/80905
    'X-Goog-AuthUser': '0',
  };
}