getBearerToken method

String? getBearerToken()

Get the bearer token from the request headers.

Implementation

String? getBearerToken() {
  if (containsKey("Authorization")) {
    String? auth = this["Authorization"];
    if (auth != null) {
      return auth.replaceFirst("Bearer ", "");
    }
  }
  return null;
}